Hi I think, the ?Which function (raster package) with the option cells=T will help you in a better way.
 
library(raster)
?Which
r <- raster(ncol=10, nrow=10)
r[] <- runif(ncell(r))
r[r< 0.5] <- NA
s <- Which(!is.na(r), cells=TRUE)
s[]
 
 


>>> jcoyle <jrcoyle@live.unc.edu> 06.10.2011 14:45 >>>
Actually, I wanted to know the cell numbers, not the values that they
contain, but I just changed what you put to

which(!is.na(values(myraster)))

and this seemed to work.  Thanks!

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/find-raster-cells-with-non-NA-values-tp6865759p6865787.html
Sent from the R-sig-geo mailing list archive at Nabble.com.

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

	[[alternative HTML version deleted]]

