library(terra)
elev <- rast(system.file("extdata/elev.tif", package="spatialEco"))
# Calculate Gaussian smoothing with sigma = 2 and 7x7 window
g1 <- raster.gaussian.smooth(elev, s=2, n=7)
plot(c(elev,g1))
Run the code above in your browser using DataLab