fars_read: fars_read: Convert the csv file content into data frame.

Description Usage Arguments Format Value Source Examples

Description

This is utility function. This is called internally, called from "fars_read_years" not intended for user call.

Usage

1
fars_read(filename)

Arguments

filename

( sample : accident_2013.csv.bz2 )

Format

A data frame with columns:

STATE

State (as number)

ST_CASE

State Case Number

VE_TOTAL

Number of Vehicle Forms Submitted- ALL

VE_FORMS

Number of Motor Vehicles in Transport (MVIT)

PVH_INVL

Number of Parked/Working Vehicles

PEDS

Number of Forms Submitted for Persons Not in Motor Vehicles

PERNOTMVIT

Number of Persons Not in Motor Vehicles in Transport (MVIT)

PERMVIT

Number of Persons in Motor Vehicles in Transport (MVIT)

PERSONS

Number of Forms Submitted for Persons in Motor Vehicles

COUNTY

County

CITY

City

DAY

Day of Crash

MONTH

Month of Crash

YEAR

Year of Crash

DAY_WEEK

Day of Week

HOUR

Hour of Crash

MINUTE

Minute of Crash

NHS

National Highway System

ROAD_FNC

Roadway Function Class (discontinued)

ROUTE

Route Signing

TWAY_ID

Trafficway Identifier

TWAY_ID2

Trafficway Identifier

MILEPT

Milepoint

LATITUDE

Latitude

LONGITUD

Longitude

SP_JUR

Special Jurisdiction

HARM_EV

First Harmful Event

MAN_COLL

Manner of Collision

RELJCT1

Relation to Junction- Within Interchange Area

RELJCT2

Relation to Junction- Specific Location

TYP_INT

Type of Intersection

WRK_ZONE

Work Zone

REL_ROAD

Relation to Trafficway

LGT_COND

Light Condition

WEATHER1

Atmospheric Conditions

WEATHER2

Atmospheric Conditions

WEATHER

Atmospheric Conditions

SCH_BUS

School Bus Related

RAIL

Rail Grade Crossing Identifier

NOT_HOUR

Hour of Notification

NOT_MIN

Minute of Notification

ARR_HOUR

Hour of Arrival at Scene

ARR_MIN

Minute of Arrival at Scene

HOSP_HR

Hour of EMS(Emergency Medical Service. e.g.Ambulance) Arrival at Hospital

HOSP_MN

Minute of EMS(Emergency Medical Service. e.g.Ambulance) Arrival at Hospital

CF1

Crash Level Factor 1

CF2

Crash Level Factor 2

CF3

Crash Level Factor 3

FATALS

Fatalities

DRUNK_DR

The DRUNK_DR data element on the Crash level was incorrectly derived on all person types from 1999 through 2007. Since then, it was derived based on all person types rather than based on Drivers only. Furthermore, the data element name (DRUNK_DR) implies that the individual was drunk, however, it actually captures those individuals whom the police reported alcohol involvement OR who tested positive for alcohol (i.e. their blood alcohol concentration was .01 g/dL or greater). Beginning with the 2008 Final FARS data file, DRUNK_DR has been derived for Drivers only

Error: throws error if the supplied file "foo" is not found, then throws the following error message "file foo does not exist"

Value

data frame with the columns, mentioned below.

Source

US National Highway Traffic Safety Administration's Fatality Analysis Reporting System. https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars

Column level understanding following link/pdf is referred. http://www.nber.org/fars/ftp.nhtsa.dot.gov/fars/FARS-DOC/Analytical User Guide/USERGUIDE-2015.pdf

Examples

1
2
3
4
## Not run: 
fars_read("accident_2013.csv.bz2")

## End(Not run)

dappaduppa/ddweek4pkg documentation built on May 26, 2019, 9:31 a.m.