redist_plans {redist} | R Documentation |
A set of redistricting plans
Description
A redist_plans
object is essentially a data frame of summary
information on each district and each plan, along with the matrix of district
assignments and information about the simulation process used to generate the
plans.
Usage
redist_plans(plans, map, algorithm, wgt = NULL, ...)
Arguments
plans |
a matrix with |
map |
a |
algorithm |
the algorithm used to generate the plans (usually "smc" or "mcmc") |
wgt |
the weights to use, if any. |
... |
Other named attributes to set |
Details
The first two columns of the data frame will be draw
, a factor indexing
the simulation draw, and district
, an integer indexing the districts
within a plan. The data frame will therefore have n_sims*ndists
rows.
As a data frame, the usual dplyr
methods will work.
Other useful methods for redist_plans
objects:
Value
a new redist_plans
object.
Examples
data(iowa)
iowa <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.05, total_pop = pop)
rsg_plan <- redist.rsg(iowa$adj, iowa$pop, ndists = 4, pop_tol = 0.05)$plan
redist_plans(rsg_plan, iowa, "rsg")