Skip to content
Prev 8412 / 29559 Next

Best way to get values of a raster that are not masked?

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