fars_read: Function to read Fatality Analysis Reporting System (FARS)...

Description Usage Arguments Value Note Source Examples

Description

FARS is a nationwide census providing NHTSA, Congress and the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes The data files are in CSV format, often compressed. Function could read CSV and BZ2 files as well. It has 50 variables=columns (eg. STATE, CITY, COUNTY, DAY, MONTH, YEAR, FATALS etc.), and around 30k records.

Usage

1
fars_read(filename)

Arguments

filename

CSV or CSV.BZ2 filename with path leading to it as Character.

Value

A tibble (tbl_df, tbl, data.frame) containing the FARS dataset

Note

Existence of the file is checked at runtime. Internally read_csv function is used, which is part of package "readr", and need to be installed beforehand. Second package dependence is dplyr, which is used for formatting output data.frame.

Source

website http://www-fars.nhtsa.dot.gov/Main/index.aspx

Examples

1
2
## Not run: fars_file<-fars_read("path_to_your_file")
## Not run: summary(fars_file)

krzyklo/fars documentation built on May 19, 2019, 8:23 a.m.