Convenience wrapper function for tidyterra::geom_spatraster().
Requires the ggplot2 and tidyterra packages.
Usage
# S3 method for class 'SpatRaster'
gg(data, ...)See also
Other geomes:
gg(),
gg.RasterLayer(),
gg.Spatial,
gg.data.frame(),
gg.fm_mesh_1d(),
gg.fm_mesh_2d(),
gg.matrix(),
gg.sf()
Examples
if (require("ggplot2", quietly = TRUE) &&
bru_safe_terra(quietly = TRUE) &&
require("tidyterra", quietly = TRUE)) {
# Load Gorilla covariates
gcov <- gorillas_sf_gcov()
# Plot the pixel centers
ggplot() +
gg(gcov$elevation)
}
#>
#> Attaching package: ‘tidyterra’
#> The following object is masked from ‘package:stats’:
#>
#> filter