gg.SpatRaster {inlabru} | R Documentation |
Geom wrapper for SpatRaster objects
Description
Convenience wrapper function for tidyterra::geom_spatraster()
.
Requires the ggplot2
and tidyterra
packages.
Usage
## S3 method for class 'SpatRaster'
gg(data, ...)
Arguments
data |
A SpatRaster object. |
... |
Arguments passed on to |
Value
The output from 'geom_spatraster.
See Also
Other geomes for spatial data:
gg()
,
gg.SpatialGridDataFrame()
,
gg.SpatialLines()
,
gg.SpatialPixels()
,
gg.SpatialPixelsDataFrame()
,
gg.SpatialPoints()
,
gg.SpatialPolygons()
,
gg.sf()
Examples
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)
}
[Package inlabru version 2.12.0 Index]