| plot {basemaps} | R Documentation |
Plot raster objects using ggplot
Description
This function plots objects of class SpatRaster, RasterLayer, RasterBrick or RasterStack as ggplot2. It is used internally by basemap* functions that return ggplot plots.
Usage
gg_raster(r, r_type = "RGB", gglayer = F, ...)
Arguments
r |
raster of class |
r_type |
character, either |
gglayer |
logical, if |
... |
additional arguments, including
|
Value
A ggplot2 object
Examples
library(basemaps)
# example extent
data(ext)
## Not run:
# raster object: Brick
map <- basemap_raster(ext)
# plotting RasterBrick
gg_raster(map, r_type = "RGB")
## End(Not run)