View source: R/plot_realization.R
plot_realization | R Documentation |
Displays realization taking into account also subpopulation density.
plot_realization(x, y, hex, ...)
x |
A SpatRaster with one layer.
Each value should correspond to a layer in |
y |
A SpatRaster with race-specific population densities |
hex |
A character vector with colors specified in hexadecimal format.
Each color should correspond to a layer in |
... |
Additional arguments as for |
library(terra)
race_raster = rast(system.file("extdata/race_raster.tif", package = "raceland"))
hex_colors = c("#F16667", "#6EBE44", "#7E69AF", "#C77213","#F8DF1D")
realization = create_realizations(race_raster, 1)
plot(race_raster)
plot(realization)
plot_realization(realization, race_raster, hex = hex_colors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.