fars_read: File extraction

Description Usage Arguments Details Value Source

Description

This function extracts data, in csv format, from the users current work directory. This function is called by the fars_read_years and fars_map_state functions. It is not called on its own. This file is not exported to the user. Data is extracted using the readr package. Once the data is read into R the dplyr package alters the look of the data frame using the tbl_df function.

Usage

1
fars_read(filename)

Arguments

filename

A character string providing the file location of the US National Highway Safety Administration's Fatality Analysis Reporting System data. The filename is constructed in the make_filename function, so this parameter should never have to be input direclty.

Details

an error will be thrown if the filename does not exist, or is not in the current working directory telling the user the file does not exist.

Value

The function returns a tbl_df, tbl, data.frame object ready for manipulation.

Source

Data is found at the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System


greegreg/fars documentation built on May 31, 2019, 8:07 a.m.