[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?)

Thanks!

--j

-- 
Jonathan Greenberg
Graduate Group in Ecology, U.C. Davis
http://www.cstars.ucdavis.edu/~jongreen
http://www.cstars.ucdavis.edu
AIM: jgrn307 or jgrn3007
MSN: jgrn307 at msn.com or jgrn3007 at msn.com




More information about the R-help mailing list