library(terra)
library(fields)
# Create sample raster
r <- rast(ncol=100, nrow=100)
values(r) <- 1:10000
# Introduce a "bubble"
values(r)[720:725] <- 9999
plot(r)
# Smooth bubble with smoothRaster
fastSmooth <- smoothRaster(r, fast = TRUE, aRange = 10.0)
plot(fastSmooth)
Run the code above in your browser using DataLab