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.
Arguments
- shp
An sf object
- adj
A zero-indexed adjacency list. Created with
redist.adjacency
if not supplied.- keep_rows
row numbers of precincts to keep. Random submap selected if not supplied.
- total_pop
numeric vector with one entry for the population of each precinct.
- ndists
integer, number of districts in whole map
- pop_tol
The strength of the hard population constraint.
- sub_ndists
integer, number of districts in subset map