Learn R Programming

⚠️There's a newer version (4.3.0) of this package.Take me there.

redist (version 3.0.1)

Simulation Methods for Legislative Redistricting

Description

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 methods described in Fifield, Higgins, Imai and Tarr (2020) , Fifield, Imai, Kawahara, and Kenny (2020) , and McCartan and Imai (2020) .

Copy Link

Version

Install

install.packages('redist')

Monthly Downloads

455

Version

3.0.1

License

GPL (>= 2)

Maintainer

Christopher T. Kenny

Last Published

April 7th, 2021

Functions in redist (3.0.1)

fl25

Florida 25 Precinct Shape File
add_reference

Add a reference plan to a set of plans
fl25_enum

All Partitions of 25 Precincts into 3 Congressional Districts (No Population Constraint)
fl25_adj

Florida 25 Precinct File
fl250

Florida 250 Precinct Shape File
as.matrix.redist

Extract the redistricting matrix from a redist object
classify_plans

Hierarchically classify a set of redistricting plans
fl70

Florida 70 Precinct Shape File
flip_constraints_helper

Flip Constraints Helper
compare_plans

Make a comparison between two sets of plans
last_plan

Extract the last plan from a set of plans
get_plans_matrix

Extract the matrix of district assignments from a redistricting simulation
pullback

Pull back plans to unmerged units
get_mh_acceptance_rate

Extract the Metropolis Hastings Acceptance Rate
preproc.shp

Preprocess shapefile arguments
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
merge_by

Merge map units
number_by

Renumber districts to match a quantity of interest
get_pop_tol

Get and set the population tolerance from a redist_map object
get_plans_weights

Extract the sampling weights from a redistricting simulation.
imp_confint

Confidence Intervals for Importance Sampling Estimates
redist.combine.mpi

Combine successive runs of redist.mcmc.mpi
redist.combine.anneal

redist.combine.anneal
redist.county.relabel

Relabel Discontinuous Counties
redist.crsg

Redistricting via Compact Random Seed and Grow Algorithm
plot.redist_plans

Summary plots for \link{redist_plans}
prec_assignment

Extract the district assignments for a precinct across all simulated plans
is_county_split

Identify which counties are split by a plan
iowa

Iowa County File
is_contiguous

Check that a redist_map object is contiguous
match_numbers

Renumber districts to match an existing plan
redist.coarsen.adjacency

Coarsen Adjacency List
prec_cooccurrence

Compute a matrix of precinct co-occurrences
redist.calc.frontier.size

Calculate Frontier Size
redist.choropleth

Creates a Choropleth
redist.combine

Combine successive runs of redist.flip
competitiveness

Compute Competitiveness
distr_compactness

Calculate compactness measures for a set of plans
redist.mcmc

MCMC Redistricting Simulator
get_target

Extract the target district population from a redist_map object
get_sampling_info

Extract the sampling information from a redistricting simulation
preproc.adj

Preprocess adjacency arguments
redist.constraint.helper

Create Constraints for SMC
redist.parity

Calculates Maximum Deviation from Population Parity
redist.ipw

Inverse probability reweighting for MCMC Redistricting
redist.mcmc.anneal

MCMC Redistricting Simulator using Simulated Annealing
freeze

Freeze Parts of a Map
redist.enumerate

Exact Redistricting Plan Enumerator
redist.county.id

Create County IDs
make_cores

Identify Cores of a District (Heuristic)
redist.map

Creates a map with optional graph overlay
redist.plot.adj

Creates a Graph Overlay
redist.read.enumpart

Read Results from enumpart
group_frac

Calculate Group Percent by District
redist.plot.plans

Plot a district assignment
redist.plot.hist

Plot a histogram of a summary statistic
redist.enumpart

Enumerate All Parititions
redist.init.enumpart

Initialize enumpart
redist.reduce.adjacency

Reduce Adjacency List
redist.plot.scatter

Scatter plot of plan summary statistics
redist.run.enumpart

Runs the enumpart algorithm
redist.prep.polsbypopper

Prep Polsby Popper Perimeter Dataframe
redist.plot.majmin

Majority Minority Plots
redist.plot.distr_qtys

Plot quantities by district
redist.plot.cores

Plot Cores
redist.samplepart

DEFUNCT: Sample partitions using spanning trees
redist.random.subgraph

Return a random subgraph of a shape
redist.plot.penalty

Visualize VRA Penalty
redist.plot.map

Plot a Map
redist.smc_is_ci

Confidence Intervals for Importance Sampling Estimates
county_splits

Count County Splits
redist.prep.enumpart

Prepares a run of the enumpart algorithm by ordering edges
redist.rsg

Redistricting via Random Seed and Grow Algorithm
redist.reindex

Reorders district numbers
redist.plot.varinfo

Static Variation of Information Plot
segregation_index

Segregation index calculation for MCMC redistricting.
redist_plans

A set of redistricting plans
redist.sink.plan

Sink Plans to 1:ndists
redist_mergesplit

Merge-Split/Recombination MCMC Redistricting Sampler
redist_quantile_trunc

Helper function to truncate importance weights
redist_shortburst

Redistricting Optimization through Short Bursts
plot.redist_classified

Plot a plan classification
redist.uncoarsen

Uncoarsen a District Matrix
subset_sampled

Subset to sampled or reference draws
redist.subset

Subset a shp
plot.redist_map

Plot a redist_map
redist_flip

'Flip' Markov Chain Monte Carlo Redistricting Simulation
redist.adjacency

Adjacency List functionality for redist
redist-package

Simulation Methods for Legislative Redistricting
redist.diagplot

Diagnostic plotting functionality for MCMC redistricting.
redist_map

Create a redist_map object.
plan_distances

Compute Distance between Partitions
redist.find.target

Find Majority Minority Remainder
redist.mcmc.mpi

MCMC Redistricting Simulator using MPI
redist.findparams

Run parameter testing for redist.mcmc
partisan_metrics

Calculate gerrymandering metrics for a set of plans
scorer-arith

Scoring function arithmetic
scorer_group_pct

Scoring functions for redist_shortburst
reexports

Objects exported from other packages
redist_smc

SMC Redistricting Sampler