interpSplines,GVector,GRaster-method | R Documentation |
This function interpolates values in the data table of a "points" GVector
to a GRaster
using splines with Tykhonov regularization to avoid overfitting.
## S4 method for signature 'GVector,GRaster'
interpSplines(
x,
y,
field,
method = "bilinear",
lambda = NULL,
solver = "Cholesky",
xlength = NULL,
ylength = NULL,
interpolate = TRUE,
verbose = is.null(lambda)
)
x |
A "points" |
y |
A |
field |
Character or integer or numeric integer: Name or index of the column in |
method |
Character: The method to use for interpolation can be either |
lambda |
Either |
solver |
Character: Type of solver to use. Can be either of |
xlength , ylength |
Either |
interpolate |
Logical: If |
verbose |
Logical: if |
If you receive the error, "No data within this subregion. Consider increasing spline step values, try increasing the values of xlength
and ylength
.
If cross-validation takes too long, or other warnings/errors persist, you can randomly subsample x
to ~100 points to get an optimum value of lambda
(using interpolate = FALSE
), then use this value in the same function again without cross-validation (setting lambda
equal to this value and interpolate = TRUE
).
Output depends on values of lambda
and interpolate
:
lambda
is NULL
and interpolate
is TRUE
: A GRaster
with an attribute named lambdas
. This is a data.frame
with values of lambda
that were assessed, plus mean
(mean residual value) and rms
(root mean square error). You can see the table using attr(output_raster, "lambdas", exact = TRUE)
.
lambda
is NULL
and interpolate
is FALSE
: A data.frame
with values of lambdas
that were assessed, plus mean
(mean residual value) and rms
(root mean square error). You can see the table using attr(output_raster, "lambdas", exact = TRUE)
.
lambda
is a number (interpolate
is ignored): A GRaster
.
interpIDW()
, fillNAs()
, GRASS module v.surf.bspline
(see grassHelp("v.surf.bspline")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.