plot_realization: Plot a Realization

View source: R/plot_realization.R

plot_realizationR Documentation

Plot a Realization

Description

Displays realization taking into account also subpopulation density.

Usage

plot_realization(x, y, hex, ...)

Arguments

x

A SpatRaster with one layer. Each value should correspond to a layer in y.

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 y and value in x.

...

Additional arguments as for terra::plotRGB()

Examples

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)

Nowosad/raceland documentation built on April 21, 2023, 10 a.m.