You might try cellValues().
Argument "cells" should be the indices of
 the non-masked cells.

Something like this:

cellInd <- 
which(getValues(r1) != mask.value)
valueVector <- cellValues(r2, 
cells = cellInd)

Jacob.

--- On Fri, 9/7/10, Jonathan Greenberg <greenb...@ucdavis.edu> wrote:

From: Jonathan Greenberg <greenb...@ucdavis.edu>
Subject: [R-sig-Geo] getValues() question
To: "Robert J. Hijmans" <r.hijm...@gmail.com>, "r-sig-geo" 
<r-sig-geo@stat.math.ethz.ch>
Date: Friday, 9 July, 2010, 20:23

r-sig-geo'ers and Robert:

If I want to pull out the values of a raster into a dataframe,
ignoring "masked" values, what is the quickest way to do this?  I can
use getValues() and "post-process" the output, but is there a way to
skip every loading these masked values into a memory in the first
place?

--j

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



      
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to