skills/22-christopherkenny-skills/skills/redistricting-analysis/SKILL.md
Redistricting analysis in R using the redistverse ecosystem. Use whenever the user is working with redist, redistmetrics, ggredist, geomander, adj, alarmdata, PL94171, censable, easycensus, tinytiger, baf, rict, or redistio. Covers the complete pipeline: Census and spatial data loading, adjacency graph construction, SMC/MCMC simulation, constraints (population balance, county splits, VRA compliance), convergence diagnostics, plan metrics (compactness, partisan fairness, splits), visualization, summary tables, and interactive plan drawing. Invoke whenever the user mentions redistricting, gerrymandering, district plans, simulation ensembles, or any redistverse package by name.
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research redistricting-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A comprehensive reference for redistricting analysis in R using the redistverse ecosystem (library(redistverse) loads redist, redistmetrics, ggredist, geomander, sf, and adj).
alarmdata, or assemble your own sf object and build a redist_map. → 12-alarmdata.mdredist_smc() (recommended) or MCMC to generate an ensemble of valid plans. → 01-redist-simulation.mdsummary()), R-hat, effective sample size, and plan diversity. → 01-redist-simulation.md| Package / Topic | Reference |
|----------------|-----------|
| redist_map, redist_smc, redist_mergesplit, redist_flip, redist_plans, diagnostics | 01-redist-simulation.md |
| redist_constr, add_constr_splits, add_constr_grp_hinge, all soft constraints | 02-redist-constraints.md |
| redist_enumpart, redist_shortburst, redist_cyclewalk, init_particles | 03-redist-advanced.md |
| redistmetrics — Polsby-Popper, Reock, spanning tree, prep_perims, comp_* functions | 04-redistmetrics-compactness.md |
| redistmetrics — efficiency gap, mean-median, bias, declination, part_* functions | 05-redistmetrics-partisan.md |
| redistmetrics — county splits, segregation, competitiveness, incumbents, plan_parity, group_frac | 06-redistmetrics-other.md |
| ggredist — geom_district, party color scales, cartographic palettes, theme_map | 07-ggredist.md |
| adj — adjacency graph construction, edge operations, coloring, Laplacian | 08-adj.md |
| geomander — adjacency construction, contiguity checks, seam_rip, edge editing | 09-geomander-adjacency.md |
| geomander — geo_match, estimate_down/up, block2prec, spatial estimation | 10-geomander-spatial.md |
| geomander — downloading VEST, ALARM, DRA, HEDA, get_lewis election data | 11-geomander-data.md |
| alarmdata — alarm_50state_map, pre-built datasets, caching, alarm_add_plan | 12-alarmdata.md |
| PL94171 — Census P.L. 94-171 decennial data ingestion | 13-pl94171.md |
| censable (data + state IDs), easycensus (ACS), tinytiger (TIGER shapefiles) | 14-census-utilities.md |
| baf — download official Census Bureau block assignment files | 15-baf.md |
| rict — gt summary tables: population, demographics, elections, compactness, splits | 16-rict.md |
| redistio — interactive Shiny plan drawing (draw()) and adjacency editor (adj_editor()) | 17-redistio.md |
redist_map — an sf tibble with one row per precinct. Stores the adjacency graph, population column, number of districts, and population tolerance. Created by redist_map() or downloaded via alarm_50state_map(). Standard columns include pop, pop_black, pop_hisp, pop_asian, pop_white, pop_vap, pop_bvap, ndv (Democratic votes), nrv (Republican votes), and geometry.
redist_plans — a tibble with one row per district per plan (so nsims × ndists rows, plus reference plans). Stores district assignments in a hidden integer matrix; metrics are added as columns via mutate(). Access the plan matrix with get_plans_matrix().
adj — an S3 vector class representing an adjacency list. Each element is a zero-indexed integer vector of neighbors. Stored as the adj column in redist_map.
| Map type | Typical pop_tol | Legal basis |
|----------|----------|-------------|
| Congressional | 0.005 (±0.5%) | Wesberry v. Sanders |
| State legislative | 0.05 (±10%) | Reynolds v. Sims |
| Local | Varies by state | State law |
tools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.