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

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