Skip to content
Prev 5445 / 29559 Next

raster package and "?focal" FUN

Hi,

I haven't used the focal function in raster, which should be able to do 
this, but in the RSAGA package there is a function called focal.function 
that does the same thing on ASCII grids. In your case this should work:

focal.function("dem",fun="max",radius=3,mw.to.vector=TRUE,mw.na.rm=TRUE)

or just

gapply("dem", "max", radius = 3)

Have a look at ?focal.function - there are examples on how to use 
customized focal functions.

I hope this helps
   Alex
gianni lavaredo wrote: