njtr1 is a package that makes it easy to download New Jersey car crash data that is released by the New Jersey Department of Transportation. This package makes it easy to access detailed information on a statewide or county-by-county process that can assist those interested in studying trends in vehicle crashes in New Jersey.
The main function of this package is
get_njtr1(). This function allows you to specify the specific table of NJTR-1 data that you'd like to query for a given year.
There are 5 different tables available with NJTR-1 data and published by the NJDOT. We will take a look at each of them in the following examples.
get_njtr1(year = 2019, type = "Accidents")
get_njtr1(year = 2019, type = "Drivers")
get_njtr1(year = 2019, type = "Vehicles")
Each of the vehicle records contain a field name
insurance_company_code that identifies the name of the insurance company that covers the vehicle involved in an accident.
This code can be used to join the vehicle data with a dataset containing details for every insurance company that does business in New Jersey.
Access the insurance from the package like so:
## # A tibble: 6 x 9 ## ID_NO NAME ADDRESS_1 ADDRESS_2 ADDRESS_3 CITY STATE ZIP NOTES ## <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> ## 1 001 SAMSUNG FIR… 25 CHALLENG… <NA> <NA> RIDGE… NJ 07660 COMM O… ## 2 002 BROTHERHOOD… PO BOX 2227 <NA> <NA> FORT … IN 07661 COMM O… ## 3 003 MID-CENTURY… 4680 WILSHI… <NA> <NA> LOS A… CA 07662 PRIV P… ## 4 004 ACE PROPERT… 1601 CHESTN… PO BOX 4… <NA> PHILA… PA 07663 COMM O… ## 5 005 FIRST NONPR… 111 NORTH C… SUITE 801 <NA> CHICA… IL 07664 COMM O… ## 6 006 EVEREST PRE… 477 MARTINS… <NA> <NA> LIBER… NJ 07665 COMM O…
The insurance dataset contains a field
ID_NO which is the same as
insurance_company_code in the Vehicles table. This common field can be used for performing join operations.
get_njtr1(year = 2019, type = "Pedestrians")
get_njtr1(year = 2019, type = "Occupants")