Package 'njtr1'

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

Help Index


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.

Description

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.

Usage

get_njtr1(year, type, county = "all", geo = FALSE)

Arguments

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)

Value

data.frame of all reported accidents for the year

Examples

get_njtr1(year = 2019, type = "Pedestrians")

Insurance companies licensed to do business in New Jersey

Description

A tibble containing all insurance companies licensed to operate in New Jersey. Can be joined with accident data.

Usage

insurance

Format

A tibble with 454 rows and 9 variables:

ID_NO

Unique ID of the insurance company

NAME

Name of company

ADDRESS_1

Address

ADDRESS_2

Address

ADDRESS_3

Address

CITY

City of insurance company

STATE

State of insurance company

ZIP

ZIP code of insurance company

NOTES

Notes

Source

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.

Description

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.

Usage

read_njtr1(file, geo = FALSE)

Arguments

file

path to a file downloaded from NJDOT

geo

Logical, whether to filter only to geotagged cases (default = FALSE)

Value

tibble of cleaned & parsed NJTR-1 data

Examples

read_njtr1(system.file("extdata/testdata/Ocean2019Accidents.zip", package = "njtr1"))