Subsets a shp object along with its adjacency. Useful for running smaller analyses on pairs of districts. Provide population, ndists, pop_tol, and sub_ndists to get proper population parity constraints on subsets.
redist.subset(
shp,
adj,
keep_rows,
total_pop,
ndists,
pop_tol,
sub_ndists,
adjacency,
population,
ndist,
popcons,
subndist
)
An sf object
A zero-indexed adjacency list. Created with
redist.adjacency
if not supplied.
row numbers of precincts to keep. Random submap selected if not supplied.
numeric vector with one entry for the population of each precinct.
integer, number of districts in whole map
The strength of the hard population constraint.
integer, number of districts in subset map
Deprecated, use adj. A zero-indexed adjacency list. Created with
redist.adjacency
if not supplied.
Deprecated, use total_pop. numeric vector with one entry for the population of each precinct.
Deprecated, use ndists. integer, number of districts in whole map
Deprecated, use pop_tol. The strength of the hard population constraint.
Deprecated, use sub_ndists. integer, number of districts in subset map
a list containing the following components:
The subsetted shp object
The subsetted adjacency list for shp
The indices of the rows kept.
The number of districts in the subset.
The new parity constraint for a subset.