[R] Readbin and file position

Jonathan Greenberg greenberg at ucdavis.edu
Fri Feb 13 03:51:00 CET 2004

I have a binary file which is an image with multiple bands, arranged in BSQ
format such that R, B and G are all N x M sized matrices (corresponding to
Red, Blue and Green colors respectively).  The BSQ file arranges the data as
[R, B, G], so to access the B matrix, I have to read forward N x M + 1
number of samples.  Is there a fast way to define a variable as the B matrix
exclusively (e.g. Can I use readbin to "fast forward" N x M + 1 samples to
the beginning of the B matrix, and then read/define the B matrix
exclusively, or do I have to read the entire file into memory, then subset
out the B matrix?)



Jonathan Greenberg
Graduate Group in Ecology, U.C. Davis
AIM: jgrn307 or jgrn3007
MSN: jgrn307 at msn.com or jgrn3007 at msn.com

More information about the R-help mailing list