Description Usage Arguments Details Value Note Examples
View source: R/fars_functions.R
Enables the importing of comma delimited text files (CSV) or tab sperated files (TSV) from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS). The data provides a statistical summary of fatalities (where a death occured within 30 days of the incident) suffered in motor vehicle accidents in the United States.
1 | fars_read(filename)
|
filename |
A character vector giving the location of the data file to be imported. |
The function uses the the readr package to read and load the csv file identified by the filename parameter. The tbl_def function returns a tibble otherwise execution of the function stops and a warning ' file accident_xxxx.csv.bz2 does not exist' is issued (where xxxx is the year of data being imported). The suppressmessages function is used to ignore all simple diagnostic messages.
A 50 column tibble with each row representing a fatal incident.
The readr and dplyr packages must be installed in the R environment but do not have to be attached.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.