powered by
redist.group.percent computes the proportion that a group makes up in each district across a matrix of maps.
redist.group.percent
group_frac( map, group_pop, total_pop = map[[attr(map, "pop_col")]], .data = cur_plans() )redist.group.percent(plans, group_pop, total_pop, ncores = 1)
redist.group.percent(plans, group_pop, total_pop, ncores = 1)
matrix with percent for each district
a redist_map object
redist_map
A numeric vector with the population of the group for every precinct.
A numeric vector with the population for every precinct.
a redist_plans object
redist_plans
A matrix with one row for each precinct and one column for each map. Required.
Number of cores to use for parallel computing. Default is 1.
data(fl25) data(fl25_enum) cd <- fl25_enum$plans[, fl25_enum$pop_dev <= 0.05] redist.group.percent(plans = cd, group_pop = fl25$BlackPop, total_pop = fl25$TotPop)
Run the code above in your browser using DataLab