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())
a redist_map()
object; the map that will be used in sampling
a redist_constr
object, which is just a list with a certain nested structure.
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:
More information about each constraint can be found on the relevant constraint page.
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)
#> A <redist_constr> with 1 constraint
#> • A splits constraint of strength 1.5