Convert RasterStack into data.frame of colors that can be used for plotting
raster_colors-RasterStack-method.Rd
This function is used internally by plot_layer
to convert a
RasterStack object to a data.frame of colors for each pixel that can be used
for plotting with ggplot2. Note that this function assumes that the first
three bands in the RasterStack objects are the RGB values and all additional
bands are ignored.
Usage
# S4 method for RasterStack
raster_colors(x)
Examples
if (FALSE) {
wi_leaf_off_layer <- get_image_layer(wi_leaf_off_url, wis_poly)
wi_leaf_off_data <- raster_colors(wi_leaf_off_layer)
}