Skip to content

NA raster replace

3 messages · Alfredo Alessandrini, Wilfried Thuiller, Matteo Mattiuzzi

#
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