Hi Jonathan, The function rasterToPoints does that. Its default behavior is to returns a matrix with coordinates and values for all cells that are not NA. You can also ask for cells with a specific range of values, and for a SptialPointDataFrame.
Robert On Wed, Jun 2, 2010 at 5:27 PM, Jonathan Greenberg <greenb...@ucdavis.edu> wrote: > I've got a file and a mask (1s for "good data", NAs for "bad"), and I > want to extract the cell values AND geographic coordinates of these > cells into a data frame or vector that correspond to the locations > where the mask is 1 -- what is the best practice for doing this? I > can loop through each row/block and do the query, but is there a > "cleaner" way of approaching this in raster()? > > --j > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo