Perform interpolation of the raster(s) produced by window_gd using autoKrige
krig_gd(
r,
grd = NULL,
index = 1,
coords = NULL,
agg_grd = NULL,
disagg_grd = NULL,
agg_r = NULL,
disagg_r = NULL,
autoKrige_output = FALSE,
lower_bound = TRUE,
upper_bound = TRUE,
krig_method = "ordinary",
resample = FALSE,
resample_first = TRUE
)a SpatRaster object or a list of autoKrige outputs (if autoKrige_output = TRUE)
SpatRaster produced by window_gd
object to create grid for kriging; can be a SpatRaster or RasterLayer. If undefined, will use r to create a grid.
integer indices of layers in raster stack to krige (defaults to 1; i.e., the first layer)
if provided, kriging will occur based only on values at these coordinates. Can be provided as an sf points, a two-column matrix, or a data.frame representing x and y coordinates
factor to use for aggregation of grd, if provided (this will decrease the resolution of the final kriged raster; defaults to NULL)
factor to use for disaggregation of grd, if provided (this will increase the resolution of the final kriged raster; defaults to NULL)
factor to use for aggregation of r, if provided (this will decrease the number of points used in the kriging model; defaults to NULL)
factor to use for disaggregation, of r if provided (this will increase the number of points used in the kriging model; defaults to NULL)
whether to return full output from autoKrige including uncertainty rasters (defaults to FALSE). If TRUE, returns a list with the kriged input raster layer ("raster"), kriged variance ("var"), kriged standard deviation ("stdev"), and full autoKrige output ("autoKrige_output").
if TRUE (default), converts all values in the kriged raster less than the minimum value of the input raster, to that minimum
if TRUE (default), converts all values in the kriged raster greater than the maximum value of the input raster, to that maximum
method to use for kriging. If ordinary, ordinary/simple kriging is performed (formula: ~ 1; default). If universal, universal kriging is performed (formula = ~ x + y).
whether to resample grd or r. Set to "r" to resample r to grd. Set to "grd" to resample grd to r (defaults to FALSE for no resampling)
if aggregation or disaggregation is used in addition to resampling, specifies whether to resample before (resample_first = TRUE) or after (resample_first = FALSE) aggregation/disaggregation (defaults to TRUE)
load_mini_ex()
wpi <- window_gd(mini_vcf, mini_coords, mini_lyr, L = 10, rarify = TRUE)
kpi <- krig_gd(wpi, mini_lyr)
plot_gd(kpi, main = "Kriged Pi")
Run the code above in your browser using DataLab