create_densities {raceland} | R Documentation |
Create Densities
Description
Calculate local densities of subpopulations (race-specific local densities)
Usage
create_densities(x, y, window_size)
Arguments
x |
SpatRaster with realizations |
y |
SpatRaster with shares of subpopulations |
window_size |
Size, expressed in the number of cells, of a square-shaped local window for which local densities will be calculated; it is recommended to use the small window_size, i.e., 10 |
Value
a SpatRaster containing n local densities. Local density layer is calculated for each realization
Examples
library(terra)
race_raster = rast(system.file("extdata/race_raster.tif", package = "raceland"))
real_rasters = create_realizations(race_raster, n = 5)
plot(real_rasters)
dens_raster = create_densities(real_rasters, race_raster, window_size = 10)
dens_raster
plot(dens_raster)
[Package raceland version 1.2.1 Index]