Analysis of traffic crashes in Illinois General Assembly districts within Chicago, including specific analyses of high-crash corridors.
- Traffic Crashes Data: City of Chicago Data Portal
- Traffic Fatalities Data: Vision Zero Chicago Traffic Fatalities
- Illinois House Districts Shapefiles
- Illinois Senate Districts Shapefiles
- Chicago Ward Boundaries
ilga_district_crashes/
├── data/
│ ├── raw/ # Original data files
│ │ ├── shapefiles/ # Geographic boundary files
│ │ │ ├── house/ # House district shapefiles
│ │ │ ├── senate/ # Senate district shapefiles
│ │ │ └── wards/ # Ward boundary files
│ │ └── crashes/ # Original crash data
│ └── processed/ # Processed data files
├── R/ # Analysis scripts
├── output/ # Generated files
│ ├── maps/ # Generated maps
│ └── summaries/ # Summary CSV files
└── README.md
utils.R: Shared functions and constantscity_crashes.R: Citywide crash analysislakeshore_crashes.R: Lake Shore Drive corridor analysisarcher_crashes.R: Archer Avenue corridor analysispulaski_crashes.R: Pulaski Road corridor analysislasalle_crashes.R: LaSalle ramp analysis
- Download the traffic crashes dataset from the City of Chicago Data Portal
- Download the fatality data from the Vision Zero Chicago Traffic Fatalities dataset
- Required fields for fatality data:
- person_id
- crash_date
- crash_location
- victim
- crash_circumstances
- longitude
- latitude
- Export as CSV using the "Export" button in the top right
- Required fields for fatality data:
- Place both downloaded CSVs in
data/raw/crashes/ - Place district shapefiles in appropriate directories:
- House district files in
data/raw/shapefiles/house/ - Senate district files in
data/raw/shapefiles/senate/ - Ward files in
data/raw/shapefiles/wards/
- House district files in
- Install required R packages:
install.packages(c( "dplyr", "readr", "purrr", "geosphere", "ggplot2", "ggmap", "magrittr", "leaflet", "sf", "osmdata", "leaflet.extras", "lubridate", "tidyr", "knitr" ))
Each script can be run independently to analyze different aspects of the crash data:
- Run
utils.Rfirst to load shared functions - Run any of the analysis scripts:
city_crashes.Rfor citywide analysislakeshore_crashes.Rfor Lake Shore Drive analysisarcher_crashes.Rfor Archer Avenue analysispulaski_crashes.Rfor Pulaski Road analysislasalle_crashes.Rfor LaSalle ramp analysis
- Summary CSVs in
output/summaries/- District-level summaries
- Corridor-specific analyses
- Crash statistics and economic impact estimates
- Interactive maps in
output/maps/- Fatality visualizations
- Crash density heatmaps
- District-level analysis maps
- Date range: 2019-01-01 to 2023-12-31
- Economic damage estimates based on NSC injury cost estimates
- Spatial analysis uses 750ft buffers for corridor analysis
- All spatial data is transformed to EPSG:4326 for consistency
The traffic crashes CSV should contain the following key fields:
- CRASH_RECORD_ID
- CRASH_DATE
- LONGITUDE
- LATITUDE
- INJURIES_TOTAL
- INJURIES_INCAPACITATING
- FIRST_CRASH_TYPE
- HIT_AND_RUN_I
This project is open source and available under the MIT License.