fars_read: Read raw Fatality Analysis Reporting System File

Description Usage Arguments Details Value Examples

Description

Read a single year of accident data into an R data_frame. Format a single years raw data downloaded from US National Highway Traffic Safety Administration's Fatality Analysis Reporting System into a R object. The file will be automatically decompressed if it uses the bz2 compression algorithm.

Usage

1
fars_read(filename)

Arguments

filename

A character string with the full path to the CSV file.

Details

If the file doesn't exist, an error will be raised.

Value

This function returns a data_frame object with the same column names used in the input data file.

Examples

1
2
3
4
5
6
7
## Not run: 
# Read uncompressed file
fars_read('data/accident_2015.csv')
# Read compressed file
fars_read('data/accident_2015.csv.bz2')

## End(Not run)

acjackman/building_r_packages documentation built on May 10, 2019, 5:11 a.m.