[R-sig-Geo] NA raster replace

Terry Griffin tgriffin at uaex.edu
Tue May 10 16:26:55 CEST 2011



Terry Griffin, PhD
tgriffin at uaex.edu
501.249.6360

-----Original Message-----
From: Alfredo Alessandrini <alfreale74 at gmail.com>
Sent: Tuesday, May 10, 2011 9:23 AM
To: r-sig-geo at r-project.org
Subject: [R-sig-Geo] NA raster replace

Hi,

I've to replace NA value with zero in some raster.

I use the raster package.

Is there a faster method than this:

funNA <- function(x) {x[is.na(x)] <- 0; return(x)}

test <- calc(test,funNA)




Alfredo

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



More information about the R-sig-Geo mailing list