[R] Problem reading binaries created with fortran

Duncan Murdoch murdoch at stats.uwo.ca
Thu Dec 17 22:00:04 CET 2009


On 17/12/2009 3:48 PM, kapo coulibaly wrote:
> Is it possible to read fortran binaries with R? I tried unsucessfully and my
> understanding is that fortran write binaries with leading and trailing
> bytes. I get numbers but not the right ones.
> Thanks
> 
> ps: the binary I'm interested in reading is a MODFLOW output with a mix of
> character, double and integers.

R can read most binary files, as long as you tell it the right format to 
read.  You need to consult the documentation of the program that 
produced the file to find out the format.  If it adds leading or 
trailing bytes, just tell R to skip over those --- but you need to know 
how much to skip.

Duncan Murdoch




More information about the R-help mailing list