redist4.3.1 package

Simulation Methods for Legislative Redistricting

add_reference

Add a reference plan to a set of plans

avg_by_prec

Average a variable by precinct (Deprecated)

classify_plans

Hierarchically classify a set of redistricting plans

compare_plans

Make a comparison between two sets of plans

constraints

Sampling constraints

get_adj

Get and set the adjacency graph from a redist_map object

get_existing

Extract the existing district assignment from a redist_map object

get_mh_acceptance_rate

Extract the Metropolis Hastings Acceptance Rate

get_plans_matrix

Extract the matrix of district assignments from a redistricting simula...

get_plans_weights

Extract the sampling weights from a redistricting simulation.

get_pop_tol

Get and set the population tolerance from a redist_map object

get_sampling_info

Extract the sampling information from a redistricting simulation

get_target

Extract the target district population from a redist_map object

is_contiguous

Check that a redist_map object is contiguous

is_county_split

Identify which counties are split by a plan

last_plan

Extract the last plan from a set of plans

match_numbers

Renumber districts to match an existing plan

merge_by

Merge map units

min_move_parity

Calculates Sparse Population Moves to Minimize Population Deviation

number_by

Renumber districts to match a quantity of interest

pl

Access the Current redist_plans() Object

plans_diversity

Calculate the diversity of a set of plans

plot.redist_classified

Plot a plan classification

plot.redist_constr

Visualize constraints

plot.redist_map

Plot a redist_map

plot.redist_plans

Summary plots for \link{redist_plans}

prec_assignment

Extract the district assignments for a precinct across all simulated p...

prec_cooccurrence

Compute a matrix of precinct co-occurrences

print.redist_classified

Print redist_classified objects

print.redist_constr

Generic to print redist_constr

print.redist_map

Generic to print redist_map

print.redist_plans

Print method for redist_plans

proj

Calculate Projective Distributions, Averages, and Contrasts for a Summ...

pullback

Pull back plans to unmerged units

rbind.redist_plans

Combine multiple sets of redistricting plans

redist_ci

Confidence Intervals for SMC and MCMC Estimates

redist_constr

Set up constraints for sampling

redist_flip_anneal

Flip MCMC Redistricting Simulator using Simulated Annealing

redist_flip

'Flip' Markov Chain Monte Carlo Redistricting Simulation (Fifield et a...

redist_map

Create a redist_map object.

redist_mergesplit_parallel

Parallel Merge-Split/Recombination MCMC Redistricting Sampler

redist_mergesplit

Merge-Split/Recombination MCMC Redistricting Sampler (Carter et al. 20...

redist_plans

A set of redistricting plans

redist_quantile_trunc

Helper function to truncate importance weights

redist_shortburst

Redistricting Optimization through Short Bursts

redist_smc

SMC Redistricting Sampler (McCartan and Imai 2023)

redist-package

redist: Simulation Methods for Legislative Redistricting

redist.adjacency

Adjacency List functionality for redist

redist.calc.frontier.size

Calculate Frontier Size

redist.coarsen.adjacency

Coarsen Adjacency List

redist.combine.mpi

Combine successive runs of redist.mcmc.mpi

redist.compactness

Calculate compactness measures for a set of plans

redist.competitiveness

Compute Competitiveness

redist.constraint.helper

Create Constraints for SMC

redist.county.id

Create County IDs

redist.county.relabel

Relabel Discontinuous Counties

redist.crsg

Redistricting via Compact Random Seed and Grow Algorithm

redist.diagplot

Diagnostic plotting functionality for MCMC redistricting.

redist.dist.pop.overlap

Compare the Population Overlap Across Plans at the District Level

redist.distances

Compute Distance between Partitions

redist.district.splits

Counts the Number of Counties within a District

redist.enumpart

Enumerate All Parititions (Fifield et al. 2020)

redist.find.target

Find Majority Minority Remainder

redist.findparams

Run parameter testing for redist_flip

redist.freeze

Freeze Parts of a Map

redist.group.percent

Calculate Group Proportion by District

redist.identify.cores

Identify Cores of a District (Heuristic)

redist.init.enumpart

Initialize enumpart

redist.ipw

Inverse probability reweighting for MCMC Redistricting

redist.mcmc.mpi

MCMC Redistricting Simulator using MPI

redist.metrics

Calculate gerrymandering metrics for a set of plans

redist.multisplits

Counts the Number of Counties Split Between 3 or More Districts

redist.muni.splits

Counts the Number of Municipalities Split Between Districts

redist.parity

Calculates Maximum Deviation from Population Parity

redist.plot.adj

Creates a Graph Overlay

redist.plot.contr_pfdr

Plot a Projective Contrast with positive False Discovery Rate (pFDR) C...

redist.plot.cores

Plot Cores

redist.plot.distr_qtys

Plot quantities by district

redist.plot.hist

Plot a histogram of a summary statistic

redist.plot.majmin

Majority Minority Plots

redist.plot.map

Plot a Map

redist.plot.penalty

(Deprecated) Visualize Group Power Penalty

redist.plot.plans

Plot a district assignment

redist.plot.scatter

Scatter plot of plan summary statistics

redist.plot.trace

Make a traceplot for a summary statistic

redist.plot.varinfo

Static Variation of Information Plot

redist.plot.wted.adj

Plot Weighted Border Adjacency

redist.prec.pop.overlap

Compare the Population Overlap Across Plans at the Precinct Level

redist.prep.enumpart

Prepares a run of the enumpart algorithm by ordering edges

redist.random.subgraph

Return a random subgraph of a shape

redist.read.enumpart

Read Results from enumpart

redist.reduce.adjacency

Reduce Adjacency List

redist.reorder

Reorders district numbers

redist.rsg

Redistricting via Random Seed and Grow Algorithm

redist.run.enumpart

Runs the enumpart algorithm

redist.segcalc

Segregation index calculation for MCMC redistricting.

redist.sink.plan

Sink Plans to 1:ndists

redist.smc_is_ci

(Deprecated) Confidence Intervals for Importance Sampling Estimates

redist.splits

Count County Splits

redist.subset

Subset a shp

redist.uncoarsen

Uncoarsen a District Matrix

redist.wted.adj

Create Weighted Adjacency Data

reexports

Objects exported from other packages

scorer-arith

Scoring function arithmetic

scorer-combine

Combine scoring functions

scorers

Scoring functions for redist_shortburst

subset_sampled

Subset to sampled or reference draws

summary.redist_plans

Diagnostic information on sampled plans

tally_var

Tally a variable by district

Enables researchers to sample redistricting plans from a pre-specified target distribution using Sequential Monte Carlo and Markov Chain Monte Carlo algorithms. The package allows for the implementation of various constraints in the redistricting process such as geographic compactness and population parity requirements. Tools for analysis such as computation of various summary statistics and plotting functionality are also included. The package implements the SMC algorithm of McCartan and Imai (2023) <doi:10.1214/23-AOAS1763>, the enumeration algorithm of Fifield, Imai, Kawahara, and Kenny (2020) <doi:10.1080/2330443X.2020.1791773>, the Flip MCMC algorithm of Fifield, Higgins, Imai and Tarr (2020) <doi:10.1080/10618600.2020.1739532>, the Merge-split/Recombination algorithms of Carter et al. (2019) <doi:10.48550/arXiv.1911.01503> and DeFord et al. (2021) <doi:10.1162/99608f92.eb30390f>, and the Short-burst optimization algorithm of Cannon et al. (2020) <doi:10.48550/arXiv.2011.02288>.

  • Maintainer: Christopher T. Kenny
  • License: GPL (>= 2)
  • Last published: 2025-10-01