# \donttest{
library(terra)
library(fields)
# Create sample raster
r <- rast(ncol=50, nrow=50)
values(r) <- 1:2500
# Introduce a "hole"
values(r)[c(117:127, 167:177, 500:550)] <- NA
plot(r)
# Patch hole with interpolateRaster
interpolatedRaster <- interpolateRaster(r)
plot(interpolatedRaster)
fastInterp <- interpolateRaster(r, fast = TRUE, aRange = 3.0)
plot(fastInterp)
# }
Run the code above in your browser using DataLab