raster_colors | R Documentation |
This function is used internally by plot_layer
to convert a
Raster* object to a data.frame of colors for each pixel that can be used for
plotting with ggplot2
raster_colors(x)
x |
A Raster* object |
A data.frame with 3 columns and length(raster_object)
rows.
Two of these columns are the x-y coordinates of each pixel, and one is a
value for color that can be used for plotting
## Not run:
wi_landcover <- get_map_layer(wi_landcover_url, wis_poly)
wi_landcover_data <- raster_colors(wi_landcover)
head(wi_landcover_data)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.