Learn R Programming

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

redist (version 3.0.7)

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

363

Version

3.0.7

License

GPL (>= 2)

Maintainer

Christopher T. Kenny

Last Published

May 15th, 2021

Functions in redist (3.0.7)

fl25_enum

All Partitions of 25 Precincts into 3 Congressional Districts (No Population Constraint)
as.matrix.redist

Extract the redistricting matrix from a redist object
compare_plans

Make a comparison between two sets of plans
fl25_adj

Florida 25 Precinct File
add_reference

Add a reference plan to a set of plans
classify_plans

Hierarchically classify a set of redistricting plans
get_adj

Get and set the adjacency graph from a redist_map object
fl25

Florida 25 Precinct Shape File
fl250

Florida 250 Precinct Shape File
get_sampling_info

Extract the sampling information from a redistricting simulation
print.redist_plans

Print method for redist_plans
get_target

Extract the target district population from a redist_map object
is_contiguous

Check that a redist_map object is contiguous
iowa

Iowa County File
imp_confint

Confidence Intervals for Importance Sampling Estimates
plot.redist_plans

Summary plots for \link{redist_plans}
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.
merge_by

Merge map units
fl70

Florida 70 Precinct Shape File
flip_constraints_helper

Flip Constraints Helper
get_mh_acceptance_rate

Extract the Metropolis Hastings Acceptance Rate
get_plans_matrix

Extract the matrix of district assignments from a redistricting simulation
last_plan

Extract the last plan from a set of plans
match_numbers

Renumber districts to match an existing plan
is_county_split

Identify which counties are split by a plan
plot.redist_classified

Plot a plan classification
pullback

Pull back plans to unmerged units
get_existing

Extract the existing district assignment from a redist_map object
prec_cooccurrence

Compute a matrix of precinct co-occurrences
prec_assignment

Extract the district assignments for a precinct across all simulated plans
redist.enumpart

Enumerate All Parititions
redist.enumerate

Deprecated: Exact Redistricting Plan Enumerator
redist.calc.frontier.size

Calculate Frontier Size
redist.coarsen.adjacency

Coarsen Adjacency List
redist.choropleth

Creates a Choropleth
distr_compactness

Calculate compactness measures for a set of plans
redist.combine

Combine successive runs of redist.flip
redist.reindex

Reorders district numbers
redist.plot.hist

Plot a histogram of a summary statistic
make_cores

Identify Cores of a District (Heuristic)
redist.plot.majmin

Majority Minority Plots
redist.init.enumpart

Initialize enumpart
redist_flip

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

Redistricting via Random Seed and Grow Algorithm
redist_map

Create a redist_map object.
competitiveness

Compute Competitiveness
freeze

Freeze Parts of a Map
group_frac

Calculate Group Percent by District
plot.redist_map

Plot a redist_map
print.redist_map

Generic to print redist_map
print.redist_classified

Print redist_classified objects
redist.county.relabel

Relabel Discontinuous Counties
redist.adjacency

Adjacency List functionality for redist
redist-package

Simulation Methods for Legislative Redistricting
redist.crsg

Redistricting via Compact Random Seed and Grow Algorithm
redist.plot.cores

Plot Cores
partisan_metrics

Calculate gerrymandering metrics for a set of plans
scorer-arith

Scoring function arithmetic
redist.mcmc.mpi

MCMC Redistricting Simulator using MPI
redist.diagplot

Diagnostic plotting functionality for MCMC redistricting.
scorer_group_pct

Scoring functions for redist_shortburst
redist.prep.polsbypopper

Prep Polsby Popper Perimeter Dataframe
redist.plot.distr_qtys

Plot quantities by district
redist.smc_is_ci

Confidence Intervals for Importance Sampling Estimates
redist.random.subgraph

Return a random subgraph of a shape
redist_mergesplit

Merge-Split/Recombination MCMC Redistricting Sampler
redist.plot.scatter

Scatter plot of plan summary statistics
redist_plans

A set of redistricting plans
redist.sink.plan

Sink Plans to 1:ndists
redist.plot.plans

Plot a district assignment
segregation_index

Segregation index calculation for MCMC redistricting.
county_splits

Count County Splits
redist_quantile_trunc

Helper function to truncate importance weights
redist_shortburst

Redistricting Optimization through Short Bursts
print.redist

Print legacy redist objects
redist.county.id

Create County IDs
redist.find.target

Find Majority Minority Remainder
redist.parity

Calculates Maximum Deviation from Population Parity
redist.findparams

Run parameter testing for redist.flip
redist.constraint.helper

Create Constraints for SMC
redist.ipw

Inverse probability reweighting for MCMC Redistricting
redist.subset

Subset a shp
redist.map

Creates a map with optional graph overlay
plan_distances

Compute Distance between Partitions
redist.uncoarsen

Uncoarsen a District Matrix
redist.plot.adj

Creates a Graph Overlay
redist.reduce.adjacency

Reduce Adjacency List
redist.read.enumpart

Read Results from enumpart
redist.prep.enumpart

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

Static Variation of Information Plot
redist.combine.mpi

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

redist.combine.anneal
redist.mcmc

MCMC Redistricting Simulator
redist.mcmc.anneal

MCMC Redistricting Simulator using Simulated Annealing
subset_sampled

Subset to sampled or reference draws
redist.plot.map

Plot a Map
redist.plot.penalty

Visualize VRA Penalty
redist.samplepart

DEFUNCT: Sample partitions using spanning trees
redist.run.enumpart

Runs the enumpart algorithm
reexports

Objects exported from other packages
redist_smc

SMC Redistricting Sampler