Learn R Programming

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

redist (version 3.1.5)

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.1.5

License

GPL (>= 2)

Maintainer

Christopher T. Kenny

Last Published

October 5th, 2021

Functions in redist (3.1.5)

fl70

Florida 70 Precinct Shape File
add_reference

Add a reference plan to a set of plans
fl250

Florida 250 Precinct Shape File
fl25_adj

Florida 25 Precinct File
fl25

Florida 25 Precinct Shape File
classify_plans

Hierarchically classify a set of redistricting plans
flip_constraints_helper

Flip Constraints Helper
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
get_plans_weights

Extract the sampling weights from a redistricting simulation.
get_existing

Extract the existing district assignment from a redist_map object
plot.redist_classified

Plot a plan classification
rbind.redist_plans

Combine multiple sets of redistricting plans
get_adj

Get and set the adjacency graph from a redist_map object
plans_diversity

Calculate the diversity of a set of plans
pullback

Pull back plans to unmerged units
is_contiguous

Check that a redist_map object is contiguous
iowa

Iowa County File
imp_confint

Confidence Intervals for Importance Sampling Estimates
get_pop_tol

Get and set the population tolerance from a redist_map object
competitiveness

Compute Competitiveness
print.redist_map

Generic to print redist_map
print.redist_plans

Print method for redist_plans
is_county_split

Identify which counties are split by a plan
redist.combine.anneal

redist.combine.anneal
redist.enumpart

Enumerate All Parititions
redist.district.splits

Counts the Number of Counties within a District
redist.combine

Combine successive runs of redist.flip
get_sampling_info

Extract the sampling information from a redistricting simulation
last_plan

Extract the last plan from a set of plans
get_target

Extract the target district population from a redist_map object
match_numbers

Renumber districts to match an existing plan
get_plans_matrix

Extract the matrix of district assignments from a redistricting simulation
get_mh_acceptance_rate

Extract the Metropolis Hastings Acceptance Rate
redist.constraint.helper

Create Constraints for SMC
number_by

Renumber districts to match a quantity of interest
merge_by

Merge map units
persily

Local Plan Optimization
redist.findparams

Run parameter testing for redist.flip
redist.find.target

Find Majority Minority Remainder
plot.redist_map

Plot a redist_map
plot.redist_plans

Summary plots for \link{redist_plans}
redist.calc.frontier.size

Calculate Frontier Size
group_frac

Calculate Group Percent by District
redist.plot.majmin

Majority Minority Plots
redist.coarsen.adjacency

Coarsen Adjacency List
redist.plot.map

Plot a Map
freeze

Freeze Parts of a Map
redist.reorder

Reorders district numbers
distr_compactness

Calculate compactness measures for a set of plans
redist.combine.mpi

Combine successive runs of redist.mcmc.mpi
print.redist_classified

Print redist_classified objects
print.redist

Print legacy redist objects
redist.dist.pop.overlap

Compare the Population Overlap Across Plans at the District Level
redist.multisplits

Counts the Number of Counties Split Between 3 or More Districts
redist.plot.hist

Plot a histogram of a summary statistic
partisan_metrics

Calculate gerrymandering metrics for a set of plans
prec_assignment

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

Read Results from enumpart
redist.reduce.adjacency

Reduce Adjacency List
redist.plot.interactive

Display an interactive map
redist.county.relabel

Relabel Discontinuous Counties
prec_cooccurrence

Compute a matrix of precinct co-occurrences
redist.county.id

Create County IDs
redist.smc_is_ci

Confidence Intervals for Importance Sampling Estimates
redist.sink.plan

Sink Plans to 1:ndists
subset_sampled

Subset to sampled or reference draws
redist_map

Create a redist_map object.
plan_distances

Compute Distance between Partitions
redist.ipw

Inverse probability reweighting for MCMC Redistricting
redist.mcmc.mpi

MCMC Redistricting Simulator using MPI
redist.parity

Calculates Maximum Deviation from Population Parity
redist.rsg

Redistricting via Random Seed and Grow Algorithm
redist.uncoarsen

Uncoarsen a District Matrix
redist_smc

SMC Redistricting Sampler
reexports

Objects exported from other packages
redist_flip

'Flip' Markov Chain Monte Carlo Redistricting Simulation
pick_a_plan

Pick One Plan from Many Plans
redist-package

Simulation Methods for Legislative Redistricting
scorer-arith

Scoring function arithmetic
redist_mergesplit

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

Creates a Graph Overlay
redist.init.enumpart

Initialize enumpart
redist.plot.plans

Plot a district assignment
redist.plot.penalty

Visualize VRA Penalty
redist.prep.polsbypopper

Prep Polsby Popper Perimeter Dataframe
make_cores

Identify Cores of a District (Heuristic)
scorer_group_pct

Scoring functions for redist_shortburst
redist.adjacency

Adjacency List functionality for redist
redist.random.subgraph

Return a random subgraph of a shape
redist.crsg

Redistricting via Compact Random Seed and Grow Algorithm
redist.diagplot

Diagnostic plotting functionality for MCMC redistricting.
county_splits

Count County Splits
redist.plot.varinfo

Static Variation of Information Plot
segregation_index

Segregation index calculation for MCMC redistricting.
redist.run.enumpart

Runs the enumpart algorithm
redist.plot.scatter

Scatter plot of plan summary statistics
redist_quantile_trunc

Helper function to truncate importance weights
redist_shortburst

Redistricting Optimization through Short Bursts
redist.subset

Subset a shp
redist.plot.distr_qtys

Plot quantities by district
redist.flip.anneal

Flip MCMC Redistricting Simulator using Simulated Annealing
redist.flip

Flip MCMC Redistricting Simulator
redist.plot.cores

Plot Cores
redist.prec.pop.overlap

Compare the Population Overlap Across Plans at the Precinct Level
redist_mergesplit_parallel

Parallel Merge-Split/Recombination MCMC Redistricting Sampler
redist_plans

A set of redistricting plans
redist.prep.enumpart

Prepares a run of the enumpart algorithm by ordering edges