本文へ移動
cccskills
無料GitHub で公開

redistricting-analysis

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.

インストール方法を見る

含まれるファイル(18)

  • SKILL.md5.8 KB
  • references/01-redist-simulation.md5.7 KB
  • references/02-redist-constraints.md5.0 KB
  • references/03-redist-advanced.md3.2 KB
  • references/04-redistmetrics-compactness.md4.1 KB
  • references/05-redistmetrics-partisan.md4.6 KB
  • references/06-redistmetrics-other.md4.5 KB
  • references/07-ggredist.md4.6 KB
  • references/08-adj.md4.2 KB
  • references/09-geomander-adjacency.md6.1 KB
  • references/10-geomander-spatial.md6.7 KB
  • references/11-geomander-data.md4.3 KB
  • references/12-alarmdata.md4.2 KB
  • references/13-pl94171.md3.6 KB
  • references/14-census-utilities.md5.2 KB
  • references/15-baf.md3.4 KB
  • references/16-rict.md3.4 KB
  • references/17-redistio.md4.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Redistricting Analysis with the redistverse

A comprehensive reference for redistricting analysis in R using the redistverse ecosystem (library(redistverse) loads redist, redistmetrics, ggredist, geomander, sf, and adj).

Standard Analysis Pipeline

  1. Load data — Download pre-built precinct map + demographics + elections via alarmdata, or assemble your own sf object and build a redist_map. → 12-alarmdata.md
  2. Prepare adjacency — Verify and edit the adjacency graph (remove water-body edges, fix topological errors). → 08-adj.md, 09-geomander-adjacency.md
  3. Set constraints — Define population tolerance, county-split penalties, VRA hinge constraints, compactness. → 02-redist-constraints.md
  4. Simulate — Run redist_smc() (recommended) or MCMC to generate an ensemble of valid plans. → 01-redist-simulation.md
  5. Validate — Check convergence (summary()), R-hat, effective sample size, and plan diversity. → 01-redist-simulation.md
  6. Score — Compute compactness, partisan fairness, splits, and other metrics across the ensemble. → 04–06 redistmetrics references
  7. Visualize & compare — Map plans, plot metric distributions, compare enacted plan to the baseline. → 07-ggredist.md

Quick Navigation

Package / TopicReference
redist_map, redist_smc, redist_mergesplit, redist_flip, redist_plans, diagnostics01-redist-simulation.md
redist_constr, add_constr_splits, add_constr_grp_hinge, all soft constraints02-redist-constraints.md
redist_enumpart, redist_shortburst, redist_cyclewalk, init_particles03-redist-advanced.md
redistmetrics — Polsby-Popper, Reock, spanning tree, prep_perims, comp_* functions04-redistmetrics-compactness.md
redistmetrics — efficiency gap, mean-median, bias, declination, part_* functions05-redistmetrics-partisan.md
redistmetrics — county splits, segregation, competitiveness, incumbents, plan_parity, group_frac06-redistmetrics-other.md
ggredist — geom_district, party color scales, cartographic palettes, theme_map07-ggredist.md
adj — adjacency graph construction, edge operations, coloring, Laplacian08-adj.md
geomander — adjacency construction, contiguity checks, seam_rip, edge editing09-geomander-adjacency.md
geomander — geo_match, estimate_down/up, block2prec, spatial estimation10-geomander-spatial.md
geomander — downloading VEST, ALARM, DRA, HEDA, get_lewis election data11-geomander-data.md
alarmdata — alarm_50state_map, pre-built datasets, caching, alarm_add_plan12-alarmdata.md
PL94171 — Census P.L. 94-171 decennial data ingestion13-pl94171.md
censable (data + state IDs), easycensus (ACS), tinytiger (TIGER shapefiles)14-census-utilities.md
baf — download official Census Bureau block assignment files15-baf.md
rict — gt summary tables: population, demographics, elections, compactness, splits16-rict.md
redistio — interactive Shiny plan drawing (draw()) and adjacency editor (adj_editor())17-redistio.md

Key Data Structures

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.

Population Tolerance Guidelines

Map typeTypical pop_tolLegal basis
Congressional0.005 (±0.5%)Wesberry v. Sanders
State legislative0.05 (±10%)Reynolds v. Sims
LocalVaries by stateState law

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

a1

無料

VS-Enhanced Research Question Refiner - Prevents Mode Collapse and derives differentiated research questions Enhanced VS 3-Phase process: Modal question avoidance, alternatives presentation, differentiated RQ recommendation Use when: refining research ideas, formulating research questions, clarifying scope Triggers: research question, 연구 질문, PICO, SPIDER, research idea

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,5982026年10月12日 更新

a2

無料

VS-Enhanced Theoretical Framework Architect with Critique & Visualization Full VS 5-Phase process: Modal theory avoidance, Long-tail exploration, differentiated framework presentation Absorbed A3 (Devil's Advocate) critique and A6 (Conceptual Framework Visualizer) capabilities Use when: building theoretical foundations, designing conceptual models, deriving hypotheses, critiquing frameworks, visualizing models Triggers: theoretical framework, 이론적 프레임워크, conceptual model, 개념적 모형, hypothesis derivation, critique, devil's advocate, 반론, visualization, diagram

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,5982026年10月12日 更新

a5

無料

Agent A5 - Paradigm & Worldview Advisor - Philosophical foundations for research design. Covers ontology, epistemology, axiology, and methodology alignment. Use when: establishing philosophical foundations, justifying methodological choices, writing positionality statements Triggers: paradigm, 패러다임, ontology, epistemology, worldview, 세계관, philosophical foundations, 철학적 기초

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,5982026年10月12日 更新

Academic paper writing skill with 12-agent pipeline. v2.5: Style Calibration (learn author's writing voice from past papers) + Writing Quality Check (writing quality checklist for natural prose). Supports IMRaD, literature review, theoretical, case study, policy brief, and conference paper structures. APA 7.0 (default), Chicago, MLA, IEEE, Vancouver citation formats. Bilingual abstracts (zh-TW + EN). Multi-format output (LaTeX, DOCX, PDF, Markdown). Triggers on: write paper, academic paper, paper outline, write abstract, revise paper, check citations, convert to LaTeX, guide my paper, parse reviews, revision roadmap, 寫論文, 學術論文, 論文大綱, 寫摘要, 修改論文, 檢查引用, 引導我寫論文, 帶我規劃論文, 逐章規劃, 論文架構, 審查意見, 修訂路線圖.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,5982026年10月12日 更新

Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready manuscript. Use when users want to: (1) write a paper from a detailed outline, (2) ensure quality control during writing, (3) maintain consistency across chapters, (4) prepare a submission-ready manuscript, or (5) systematically execute a planned paper. Triggered by phrases like 'write the paper from this outline,' 'compose the full manuscript,' 'execute the outline,' or when users have completed strategic planning (academic-paper-strategist skill) and are ready to write. Takes optimized outline as input; outputs complete manuscript with iterative quality checks.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,5982026年10月12日 更新

Multi-perspective academic paper review with dynamic reviewer personas. Simulates 5 independent reviewers (EIC + 3 peer reviewers + Devil's Advocate) with field-specific expertise. Supports full review, re-review (verification), quick assessment, methodology focus, and Socratic guided modes. Triggers on: review paper, peer review, manuscript review, referee report, review my paper, critique paper, simulate review, editorial review.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,5982026年10月12日 更新

brycewang-stanford のスキルをすべて見る

このスキルの問題を報告する