Title: | Download, Analyze & Clean New Jersey Car Crash Data |
---|---|
Description: | Download and analyze motor vehicle crash data released by the New Jersey Department of Transportation (NJDOT). The data in this package is collected through the filing of NJTR-1 form by police officers, which provide a standardized way of documenting a motor vehicle crash that occurred in New Jersey. 3 different data tables containing data on crashes, vehicles & pedestrians released from 2001 to the present can be downloaded & cleaned using this package. |
Authors: | Gavin Rozzi [aut, cre] |
Maintainer: | Gavin Rozzi <[email protected]> |
License: | GPL-3 |
Version: | 0.3.2 |
Built: | 2024-11-26 04:07:20 UTC |
Source: | https://github.com/gavinrozzi/njtr1 |
Download New Jersey car accident records for a given year. Returns a data frame of car crash based upon the table type and year specified.
get_njtr1(year, type, county = "all", geo = FALSE)
get_njtr1(year, type, county = "all", geo = FALSE)
year |
Year to download crash data for |
type |
The table of NJDOT crash data to download |
county |
Specify a specific county to download data for (default = all) |
geo |
Logical, whether to filter only to geotagged cases (default = FALSE) |
data.frame of all reported accidents for the year
get_njtr1(year = 2019, type = "Pedestrians")
get_njtr1(year = 2019, type = "Pedestrians")
A tibble containing all insurance companies licensed to operate in New Jersey. Can be joined with accident data.
insurance
insurance
A tibble with 454 rows and 9 variables:
Unique ID of the insurance company
Name of company
Address
Address
Address
City of insurance company
State of insurance company
ZIP code of insurance company
Notes
https://www.nj.gov/mvc/pdf/vehicles/insurance_codes.pdf
Read an NJTR-1 data file that was previously downloaded. This function will read a .zip or .txt file in the format published by the NJDOT and return a data frame with cleaned data.
read_njtr1(file, geo = FALSE)
read_njtr1(file, geo = FALSE)
file |
path to a file downloaded from NJDOT |
geo |
Logical, whether to filter only to geotagged cases (default = FALSE) |
tibble of cleaned & parsed NJTR-1 data
read_njtr1(system.file("extdata/testdata/Ocean2019Accidents.zip", package = "njtr1"))
read_njtr1(system.file("extdata/testdata/Ocean2019Accidents.zip", package = "njtr1"))