Learn R Programming

redist (version 2.0.2)

redist.samplepart: Sample partitions using spanning trees

Description

redist.samplepart uses a spanning tree method to randomly sample redistricting plans.

Usage

redist.samplepart(adjobj, ndists, popvec, pop_filter, pop_constraint,
contiguitymap, nsamp, n_cores)

Arguments

adjobj

An adjacency list, matrix, or object of class SpatialPolygonsDataFrame.

ndists

The desired number of congressional districts

popvec

Population vector for adjacency object. Provide if filtering by population

pop_filter

Boolean. Whether or not to filter on population parity. Default is FALSE.

pop_constraint

Strength of population filter if filtering on distance to parity.

contiguitymap

Use queens or rooks distance criteria for generating an adjacency list from a "SpatialPolygonsDataFrame" data type. Default is "rooks".

nsamp

Number of samples to draw. Default is 1000.

n_cores

Number of cores to parallelize over for parity calculation and compactness calculation. Default is 1.

Value

redist.samplepart returns a list where the first entry is the randomly sampled redistricting plan, and the second entry is the number of possible redistricting plans from the implied spanning tree.