| gg.SpatRaster | R Documentation |
Convenience wrapper function for tidyterra::geom_spatraster().
Requires the ggplot2 and tidyterra packages.
## S3 method for class 'SpatRaster'
gg(data, ...)
data |
A SpatRaster object. |
... |
Arguments passed on to |
The output from 'geom_spatraster.
Other geomes for spatial data:
gg(),
gg.SpatialGridDataFrame(),
gg.SpatialLines(),
gg.SpatialPixels(),
gg.SpatialPixelsDataFrame(),
gg.SpatialPoints(),
gg.SpatialPolygons(),
gg.sf()
if (require("ggplot2", quietly = TRUE) &&
requireNamespace("terra", quietly = TRUE) &&
require("tidyterra", quietly = TRUE)) {
# Load Gorilla covariates
gcov <- gorillas_sf_gcov()
# Plot the pixel centers
ggplot() +
gg(gcov$elevation)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.