[R-sig-Geo] Using a mask

Ned Horning horning at amnh.org
Fri Feb 27 15:35:23 CET 2009


Is there an easy way to mask (or flag) data values in R so they do not 
get processed. I am using predict.randomForest on a satellite image and 
there are a lot (~30%) of pixels with a value of "0" that I'd prefer not 
to process with predict.randomForest to save time. I was thinking it 
might be possible to create a data frame with valid data for each line 
read from the input multi-band image and then reconstruct the line 
before writing it out but I think the overhead would be very high. At 
least using the brute force methods like rbind.

All the best,

Ned



More information about the R-sig-Geo mailing list