Learn R Programming

redist (version 3.0.7)

redist.samplepart: DEFUNCT: Sample partitions using spanning trees

Description

redist.samplepart uses a spanning tree method to randomly sample redistricting plans. DEFUNCT, use redist_smc instead.

Usage

redist.samplepart(
  adj,
  ndists,
  total_pop = NULL,
  pop_filter = FALSE,
  pop_tol = 0.5,
  nsims = 1000,
  ncores = 1,
  adjobj,
  popvec,
  pop_constraint,
  contiguitymap = "rooks",
  nsamp,
  n_cores
)

Arguments

adj

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

ndists

The desired number of congressional districts

total_pop

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_tol

Strength of population filter if filtering on distance to parity.

nsims

Number of samples to draw. Default is 1000.

ncores

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

adjobj

Deprecated, use adj. An adjacency list, matrix, or object of class SpatialPolygonsDataFrame.

popvec

Deprecated, use total_pop. Population vector for adjacency object. Provide if filtering by population

pop_constraint

Deprecated, use pop_tol. 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

Deprecated, use nsims. Number of samples to draw. Default is 1000.

n_cores

Deprecated, use ncores. 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.