Plot.SpatRast | R Documentation |
Use the ggplot2 plotting engine to easily create visualisations of raster data - like the ones obtained using CDownloadS(...) - and overlay sf polygon data if desired.
Plot.SpatRast(
SpatRast,
SF,
Dates,
Legend = "Air Temperature [K]",
COL = viridis::inferno(100),
Size = 1,
Shape = 1
)
SpatRast |
SpatRast object to visualise. |
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 object. |
Legend |
Colour label legend. |
COL |
Colour palette. |
Size |
Optional. Size of SF overlay. |
Shape |
Optional. Shape of SF overlay if points. |
A ggplot2 object visualising a raster.
CDownloadS
.
SpatRast <- terra::rast(system.file("extdata", "CentralNorway.nc", package = "KrigR"))[[1:2]]
data("Jotunheimen_poly")
SF <- Jotunheimen_poly
Plot.SpatRast(SpatRast = SpatRast, SF = SF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.