[R-sig-Geo] extracting non-NA values from RasterLayer

Carson Farmer carson.farmer at gmail.com
Wed Apr 25 12:26:56 CEST 2012


Dear list, I am currently dealing with extremely large raster datasets
(100s of millions of cells), and am masking out large regions which
are of no particular interest for our current project. This produces
RasterLayers with a large number of NAs (but still millions of non-NA
cells as well). What I'd like to do is extract all non-NA values into
a vector for use in various statistical analyses, but I am having
trouble finding the most efficient means of doing so. Any pointers? I
have tried "sampleRandom", which is supposed to only take non-NA
cells, but there must be a better/faster way to extract *all* non-NA
values that I've just missed.

Cheers,

Carson

-- 
Dr. Carson J. Q. Farmer
Centre for GeoInformatics (CGI)
School of Geography and Geosciences
Irvine Building, University of St Andrews
St Andrews, Fife, KY16 9AL
Scotland, UK



More information about the R-sig-Geo mailing list