gplot_data: Transform raster as data.frame to be later used with ggplot...

Description Usage Arguments Details

View source: R/gplot_data.R

Description

Transform raster as data.frame to be later used with ggplot Modified from rasterVis::gplot

Usage

1
gplot_data(x, maxpixels = 50000)

Arguments

x

A Raster* object

maxpixels

Maximum number of pixels to use

Details

rasterVis::gplot is nice to plot a raster in a ggplot but if you want to plot different rasters on the same plot, you are stuck. If you want to add other information or transform your raster as a category raster, you can not do it. With 'cartomisc::gplot_data', you retrieve your raster as a data.frame that can be modified as wanted using 'dplyr' and then plot in 'ggplot' using 'geom_tile'. If Raster has levels, they will be joined to the final tibble.


statnmap/cartomisc documentation built on Aug. 20, 2020, 2:22 a.m.