interpolateRaster {voluModel} | R Documentation |
Interpolate patchily sampled rasters
Description
Uses thin plate spline regression from
fields
package to interpolate missing two-dimensional
raster values.
Usage
interpolateRaster(inputRaster, fast = FALSE, ...)
Arguments
inputRaster |
An object of class |
fast |
A logical operator. Setting to |
... |
For any additional arguments passed to |
Details
Missing data values from original raster
are replaced with interpolated values. 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.
Value
An object of class raster
See Also
Examples
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)
[Package voluModel version 0.2.1 Index]