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
rict generates formatted gt tables summarizing redistricting plans — population parity, demographics, election results, compactness, splits, and contiguity — designed for inclusion in reports and court filings. All functions accept a redist_map or sf object plus a plan assignment and return a gt::gt_tbl by default, or a plain tibble when as_gt = FALSE.
All functions share the same basic signature:
rict_*(map, plan, ..., as_gt = TRUE)
| Function | What it shows |
|---|---|
rict_population() | Population per district, deviation from ideal, % deviation |
rict_demographics() | Total pop and VAP by race/ethnicity (White, Black, Hispanic, Asian, AIAN, NHPI, Other, Two+) |
rict_elections() | Democratic vote shares across electoral contests by district |
rict_compactness() | Polsby-Popper, Schwartzberg, Reock, Convex Hull scores per district |
rict_splits() | Number of counties (or other admin units) split by the plan |
rict_contiguity() | Number of disconnected geographic pieces per district |
rict_boundary() | Precincts along the boundary between two specified districts |
rict_component() | Population by administrative unit within each district |
library(rict)
library(redistverse)
map <- alarm_50state_map('MD')
# Population table for the enacted plan
rict_population(map, plan = map$cd_2020)
# Demographics table
rict_demographics(map, plan = map$cd_2020)
# Compactness (uses Polsby-Popper, Schwartzberg, Reock, Convex Hull by default)
Next to this one in the catalogue, plus more from the same author.