How to write .bin file in R and open it in Fortran
问题 I have a Fortran model that I would like to force with data coming from a model developed in R, but I have trouble transferring the data between the two environments. I was thinking about using a .bin file. What I am doing in R is using writeBin to store a multi-dim array in a .bin file: a = seq(1,150,1) my.array <- array(a, dim=c(10,5,3)) zz <- file("test.bin", "wb") writeBin (as.vector(my.array),zz) close(zz) I can read the .bin file in R without problem again... zz <- file("test.bin", "rb"