Re: [R] Reading binary files

2012-06-12 Thread Nortisiv
Rui Barradas wrote > > Hello, > > From the help page for readBin: > > "readBin and writeBin read and write C-style zero-terminated character > strings." > > > Your description of the string doesn't match this one. To read any sort > of character strings, use readChar. > > readChar(to.read

Re: [R] Reading binary files

2012-06-12 Thread Rui Barradas
Hello, From the help page for readBin: "readBin and writeBin read and write C-style zero-terminated character strings." Your description of the string doesn't match this one. To read any sort of character strings, use readChar. readChar(to.read, nchars = 4, useBytes = TRUE) Many times, w

[R] Reading binary files

2012-06-12 Thread Nortisiv
Hey guys, I am currently trying to read in a binary file using this helpful manual: http://www.ats.ucla.edu/stat/r/faq/read_binary.htm Reading binary files I also have the detailed format description from the developer. But somehow the reading of the file does still not work properly. The first

Re: [R] Reading Binary Files

2009-02-11 Thread Henrik Bengtsson
Argument 'size' is what you are looking for, cf. help(readBin). Whenever reading binary files this way, I strongly recommend that you are explicit about all arguments of readBin(), e.g. readBin(con, what=integer(), size=2, signed=TRUE, endian="little", n=n); For instance, you probably do not want

[R] Reading Binary Files

2009-02-11 Thread Steve_Friedman
Hello I'm encountering some difficulty correctly reading binary files. The binary files store data as "short" rather than "double" , "int", or any of the other modes of the vector being read. The data represents a regular grid of size 419 rows by 264 columns, to make it more interesting, the d