This repository loads, combines, and cleans public datasets released by the Louisiana Department of Public Safety & Corrections (DPSC). It pulls raw files directly from the DOC website, connects categorical codes using the official codebook, and produces analysis-ready dataframes across six data types.
As of May, the Louisiana DPSC publishes several datasets on incarceration, supervision, and mortality. This pipeline automates the full process of:
- Downloading raw CSVs and Excel files directly from
doc.la.gov. - Combining files across time periods into unified dataframes.
- Decoding coded fields (race, offense, parish, facility, supervision type) via the official codebook.
- Cleaning and standardizing dates, sentence lengths, flags, and demographics.
- Saving both raw and processed outputs as
.rdsfiles.
All files are downloaded directly from the Louisiana DPSC website. The pipeline currently covers:
| Dataset | Period Covered | Description |
|---|---|---|
| Incarceration Snapshots | Dec 2025 – Mar 2026 | Monthly point-in-time views of the incarcerated population |
| Admissions | 2019 - 2025 | All prison admissions by year |
| Releases | 2016 – 2025 | All prison releases by year |
| Probation & Parole Snapshot | Feb 2026 | Point-in-time supervised population |
| Deaths | 2018 - 2025 | In-custody deaths with cause |
| Facility Census | Jan 2025 – Mar 2026 | Monthly headcounts by facility and custody type |
| Codebook | Latest | Official lookup tables for all coded fields |
Unmodified data as downloaded, stored as named lists of dataframes:
snapshot.rdsadmit.rdsrelease.rdspp.rdsdeath.rdscensus.rds
Cleaned, decoded, and analysis-ready dataframes:
| File | Key Variables |
|---|---|
snapshots_clean.rds |
Location, race, sex, age, sentence length, offense, flags |
admits_clean.rds |
Admission date, parish, race, sex, sentence type, time-to-release estimates |
release_clean.rds |
Admission/release dates, years served, offense, release reason |
pp_clean.rds |
Supervision type, admission/end dates, offense, flags |
deaths_clean.rds |
Death date, cause, race, gender, years until death |
census_clean.rds |
Prison, custody type, facility, monthly population counts |
- Dates are parsed from multiple formats (
YYYYMMDD,YYYY-MM-DD,MM/DD/YYYY) via a unifiedparse_mixed_date()function. - Sentence lengths are decoded from a packed 7-digit format (
YYYMMdd-> years + months/12 + days/365.25). - Flags (
sex_offender,violent,habitual) are standardized from"X"markers to logicalTRUE/FALSE. - Offense, race, parish, and location codes are replaced with human-readable literals via codebook join.
- Census files are cleaned into a tidy facility-level format.