[R-sig-Geo] Function to smooth grids using n x n window moving average (low-pass filter)

Robert Hijmans r.hijmans at gmail.com
Wed Jan 19 18:14:41 CET 2011


> I was trying to do add the ability to ignore NAs (just like it's in the sum
method with na.rm = TRUE). 
> I can't find the way however. 

You can also compare with the focal functions in raster; that should support
NA values

library(raster)
r  = raster(meuse.grid, "log.zinc")
rf = focal(r, 3)
 

-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Function-to-smooth-grids-using-n-x-n-window-moving-average-low-pass-filter-tp2765093p5940533.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list