Plot.Kriged | R Documentation |
Use the ggplot2 plotting engine to easily create visualisations of kriged raster data and associated uncertainties raster data - like the ones obtained using Kriging(...) - and overlay sf polygon data if desired.
Plot.Kriged(
Krigs,
SF,
Dates,
Legend = "Air Temperature [K]",
Size = 1,
Shape = 1
)
Krigs |
List of length 2. Containing kriging prediction SpatRast in slot 1 and kriging standard error SpatRast in slot 2. |
SF |
Optional. SF object which to overlay. |
Dates |
Optional. Character vector of labels to apply to each layer of the SpatRast. By default, the content of the terra::time() field of the supplied SpatRast objects in list. |
Legend |
Colour label legend. |
Size |
Optional. Size of SF overlay. |
Shape |
Optional. Shape of SF overlay if points. |
A ggplot2 object visualising a raster.
Kriging
.
CDS_rast <- terra::rast(system.file("extdata", "CentralNorway.nc", package = "KrigR"))
Cov_train <- terra::rast(system.file("extdata", "Covariates_Train.nc", package = "KrigR"))
Cov_target <- terra::rast(system.file("extdata", "Covariates_Target.nc", package = "KrigR"))
names(Cov_train) <- names(Cov_target) <- "GMTED2010 [m]"
### kriging itself
ExtentKrig <- Kriging(
Data = CDS_rast[[1:2]],
Covariates_training = Cov_train,
Covariates_target = Cov_target,
Equation = "GMTED2010",
Cores = 2,
FileName = "KrigTest1",
FileExtension = ".nc",
Keep_Temporary = TRUE,
nmax = 40,
verbose = TRUE
)
Plot.Kriged(Krigs = ExtentKrig)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.