Learn R Programming

alarmdata

alarmdata provides utility functions to download and process data produced by the ALARM Project, including 2020 redistricting files and 50-State Redistricting Simulations.

Installation

You can install alarmdata with:

install.packages("alarmdata")

You can also install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("alarm-redist/alarmdata")

Example

We can easily download simulation data for a state and make some plots.

library(alarmdata)
library(redist)

map_wa = alarm_50state_map("WA")
plans_wa = alarm_50state_plans("WA")

redist.plot.plans(plans_wa, draws=1:4, shp=map_wa)

hist(plans_wa, e_dem) +
    ggplot2::labs(x=NULL, title="Expected Democratic seats")

Downloads will go to options(alarm.cache_dir) if it is set. If it is not, and options(alarm.use_cache = TRUE), downloads will be cached between sessions in rappdirs::user_cache_dir("alarm"). If If options(alarm.use_cache = FALSE) (the default), then the cache will be in a temporary directory that does not persist between sessions. You can check the size of the cache and clear it with alarm_cache_size() and alarm_cache_clear().

Copy Link

Version

Install

install.packages('alarmdata')

Monthly Downloads

329

Version

0.2.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Christopher T. Kenny

Last Published

December 12th, 2025

Functions in alarmdata (0.2.4)

alarm_50state

Download maps and plans from the 50-State Simulation Project
alarmdata-package

alarmdata: Download, Merge, and Process Redistricting Data
alarm_census_vest

Download Joined VEST and Census Data
alarm_epsg

Suggested EPSG Codes
alarm_cache_size

Work with the the alarmdata cache
alarm_japan

Download maps and plans from the Japan 47-Prefecture Simulation Project
alarm_add_plan

Add a reference plan to a set of plans