njtr1
An R package that makes it easy to download and analyze New Jersey motor vehicle crash data for transportation research and safety analysis.
CRAN
Platform
2001-Present
Data Years
MIT
License
Overview
njtr1 is an R package that makes it easy to obtain detailed data on car crashes in New Jersey for transportation planning, analysis and research. The package downloads data published by the New Jersey Department of Transportation collected when police officers file the NJTR-1 form following a motor vehicle crash.
The Problem It Solves
The NJDOT provides crash data in a format that’s difficult to work with:
- Zipped TXT files without column headers
- Manual navigation through dropdown menus to download
- No direct links or API access
- Over 50 column names must be looked up manually
Features
- Automated Downloads: Simple functions to download any year’s data
- Data Cleaning: Properly formatted column names and data types
- Multiple Tables: Access to Accidents, Vehicles, Drivers, Occupants, and Pedestrians data
- Tibble Output: Data returned in tidy format ready for analysis
Usage Example
library(njtr1)
# Get crash data for 2019
get_njtr1(year = 2019, type = "Accidents")
# Get vehicle data
get_njtr1(year = 2019, type = "Vehicles")
# Get driver data
get_njtr1(year = 2019, type = "Drivers")
Academic Recognition
This package was the subject of a peer-reviewed publication in Software Impacts journal, highlighting its contribution to transportation research methodology.