View source: R/redist_constr.R
redist_constr | R Documentation |
redist_constr
objects are used to specify constraints when sampling
redistricting plans with redist_smc()
and redist_mergesplit()
. Each
constraint is specified as a function which scores a given plan. Higher
scores are penalized and sampled less frequently.
redist_constr(map = tibble())
map |
a |
The redist_constr
object keeps track of sampling constraints in a nested list.
You can view the exact structure of this list by calling str()
.
Constraints may be added by using one of the following functions:
add_constr_compet()
add_constr_custom()
add_constr_edges_rem()
add_constr_fry_hold()
add_constr_grp_hinge()
add_constr_grp_inv_hinge()
add_constr_grp_pow()
add_constr_incumbency()
add_constr_log_st()
add_constr_multisplits()
add_constr_polsby()
add_constr_pop_dev()
add_constr_segregation()
add_constr_splits()
add_constr_status_quo()
add_constr_total_splits()
More information about each constraint can be found on the relevant constraint page.
a redist_constr
object, which is just a list with a certain nested structure.
data(iowa)
map_ia <- redist_map(iowa, existing_plan = cd_2010, pop_tol = 0.01)
constr <- redist_constr(map_ia)
constr <- add_constr_splits(constr, strength = 1.5, admin = region)
print(constr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.