Uses thin plate spline regression from fields package to smooth raster values.

smoothRaster(inputRaster, fast = FALSE, ...)

Arguments

inputRaster

An object of class SpatRaster

fast

A logical operator. Setting to TRUE triggers use of fastTps instead of Tps.

...

For any additional arguments passed to Tps or fastTps

Value

An object of class SpatRaster

Details

Original raster is smoothed using a thin plate spline. This may be desirable in cases where the user has a reasonable expectation of spatial autocorrelation, but observes putative measurement errors in a raster. The user has the option of choosing fastTps to speed calculation, but be advised that this is only an approximation of a true thin plate spline.

See also

Examples

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)