Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Runs redistricting analysis in R with the redistverse packages, covering data loading, simulation, constraints, metrics and visualization.
45% 86%+41 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 10 of 22 without it.
To obtain official Census Bureau Block Assignment Files (BAF) for state legislative redistricting reconciliation in R, which package provides a direct function to download these BAF files?
The response recommends using the baf package.
3 of 3 safety checks passed
geomander includes functions for downloading pre-processed election and geographic datasets from several sources: VEST (Voting and Election Science Team), the ALARM Project, Dave's Redistricting App (DRA), and the Harvard Election Data Archive (HEDA). These are useful when you need election data for states not yet in alarmdata or when working with historical elections.
VEST provides precinct-level election returns for many states and election cycles, harmonized to a consistent format.
library(geomander)
# List available states
vest_states() # returns a tibble of state/year combinations available
# Download VEST data for a state and year
vest_data <- get_vest(state = 'VA', year = 2018)
# Returns an sf object with precinct geometry + election columns
Column naming convention: G{YY}{OFFICE}{PARTY}{CANDIDATE} e.g., G18USSRKAV = 2018 US Senate, Republican, Kavanaugh.
# Clean VEST column names to a standardized format
cleaned <- clean_vest(vest_data)
Download ALARM Project datasets (alternative to the alarmdata package functions):
# List available states in the ALARM dataset
alarm_states() # tibble of states and what's available
# Download an ALARM dataset
alarm_data <- get_alarm(state = 'MD')
# Returns a list with map and plans components
Next to this one in the catalogue, plus more from the same author.