redist_plans | R Documentation |
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.
redist_plans(plans, map, algorithm, wgt = NULL, ...)
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 |
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:
summary.redist_plans
add_reference
subset_sampled
subset_ref
pullback
number_by
match_numbers
is_county_split
prec_assignment
plan_distances
get_plans_matrix
get_plans_weights
get_sampling_info
as.matrix.redist_plans
plot.redist_plans
a new redist_plans
object.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.