group_frac | R Documentation |
redist.group.percent
computes the proportion that a group makes up in
each district across a matrix of maps.
group_frac(
map,
group_pop,
total_pop = map[[attr(map, "pop_col")]],
.data = pl()
)
redist.group.percent(plans, group_pop, total_pop, ncores = 1)
map |
a |
group_pop |
A numeric vector with the population of the group for every precinct. |
total_pop |
A numeric vector with the population for every precinct. |
.data |
a |
plans |
A matrix with one row for each precinct and one column for each map. Required. |
ncores |
Number of cores to use for parallel computing. Default is 1. |
matrix with percent for each district
data(fl25)
data(fl25_enum)
cd <- fl25_enum$plans[, fl25_enum$pop_dev <= 0.05]
fl25_map = redist_map(fl25, ndists=3, pop_tol=0.1)
fl25_plans = redist_plans(cd, fl25_map, algorithm="enumpart")
group_frac(fl25_map, BlackPop, TotPop, fl25_plans)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.