Skip to contents

Estimating Across Geographic Levels

Functions for approximating values at different levels of geography

estimate_down()
Estimate Values Down Using Precomputed Matches
estimate_up()
Aggregate Values Up Using Precomputed Matches
geo_estimate_down()
Estimate Values Down to a Finer Geography
geo_estimate_up()
Aggregate Values Up to a Larger Geography
geo_match()
Match Features Across Geographic Layers

Buiding Datasets

Functions to help build and refine data

block2prec()
Aggregate a Block Table by Matches
block2prec_by_county()
Aggregate a Block Table by Matches Within County
create_block_table()
Create a Census Block-Level Table
create_tract_table()
Create an ACS Tract-Level Table
geo_filter()
Filter to Intersecting Pieces
geo_trim()
Trim Away Small Pieces

Downloading Datasets

Functions to help download common datasets

alarm_states()
List Available States from ALARM Data
clean_vest()
Clean VEST Column Names
get_alarm()
Get an ALARM Dataset
get_dra()
Get a Dave's Redistricting App Dataset
get_heda()
Get a Harvard Election Data Archive ("HEDA") Dataset
get_vest()
Get a Voting and Election Science Team ("VEST") Dataset
heda_states()
List Available HEDA States
vest_states()
List Available VEST States

Fixing Geographic Imperfections

Functions to help pretend that the geographies were properly connected

add_edge()
Add Edges to an Adjacency List
adjacency()
Build an Adjacency List
check_contiguity() cct() ccm()
Check Contiguity by Group
check_polygon_contiguity()
Check Polygon Contiguity
compare_adjacencies()
Compare Adjacency Lists
geo_sort()
Sort Features by Northwest-to-Southeast Order
split_precinct()
Split a Precinct
subtract_edge()
Remove Edges from an Adjacency List
suggest_component_connection()
Suggest Connections for Disconnected Groups
suggest_neighbors()
Suggest Neighbors for Lonely Precincts

Format Data with Dave’s Redistricting

Functions to get maps into DRA or from DRA

dra2r()
Convert DRA Export Data to an R Spatial Object
r2dra()
Convert an R Plan to DRA Block Assignment Format

Center of Shape

Adjusted centroids to ensure that the point is in the shape

geos_centerish()
Get the kind of center of each shape
geos_circle_center()
Get the centroid of the maximum inscribed circle
st_centerish()
Get the kind of center of each shape
st_circle_center()
Get the Center of the Maximum Inscribed Circle

Tools for working with borders

Functions that deal with two sides of a seam between two administrative units

seam_adj()
Filter Adjacency to the Edges Along a Seam
seam_geom()
Filter Shapes to Units Along a Seam
seam_rip()
Remove Edges Across an Administrative Boundary
seam_sew()
Suggest Edges to Sew a Seam

Spatial Autocorrelation

Functions to measure local and global autocorrelation measures

global_gearys()
Compute Global Geary's C
global_morans()
Compute Global Moran's I
gstar_i()
Compute Standardized Getis-Ord G*i
local_gearys()
Compute Local Geary's C
local_morans()
Compute Local Moran's I

Included Example Data

checkerboard
Checkerboard
checkerboard_adj
Checkerboard Adjacency
nrcsd
nrcsd
orange
orange
precincts
precincts
rockland
rockland
towns
towns
va18sub
va18sub
va_blocks
va_blocks
va_blocks
va_vtd

Plotting Functions

geo_plot()
Plot an sf Object with Row Numbers
geo_plot_group()
Plot Groups with Connected Components Colored

Leftovers

Functions that don’t really fit elsewhere

geomander-package geomander
Geographic Tools for Studying Gerrymandering
baf_to_vtd()
Estimate Plans from a Block Assignment File to Voting Districts
count_connections()
Count How Often Pairs of Units Share a District
get_lewis()
Get Historical United States Congressional District Shapefiles
get_rpvnearme()
Get the RPV Near Me Dataset
regionalize()
Estimate Regions Separated by Geographic Features