Description Usage Arguments Details Value See Also Examples
View source: R/fars_functions.R
fars_read() takes in a *.csv file from the NHTSA's FARS #' archives and returns a tibble.
1 | fars_read(filename)
|
filename |
Relative filepath to the current working directory. This must be an existing comma separated values file (*.csv) or it will throw an error. |
This function takes in a *.csv file and using the readr package will load the file as a tibble then will return it as a tbl_df (subclass of a data.frame) through dplyr. This function is ideally to be used with the FARS (Fatality Analysis Reporting System) archives for accident data in *.csv format. If no file exists an error will occur before attempting to read the file.
A tibble from the inputted *.csv file.
https://www.nhtsa.gov/file-downloads?p=nhtsa/downloads/FARS/ for other .csv files from FARS (Fatality Analysis Reporting System) to process. Explore the NHTSA's website for more information on the FARS program.
Other FARS functions:
fars_map_state()
,
fars_read_years()
1 2 3 4 5 6 | # this will stop
## Not run: fars_read("this_file_does_not_exist.csv")
#returns data as tbl_df
#setwd(system.file("data-raw", package = "wk4package"))
#getwd()
## Not run: fars_read("accident_2013.csv.bz2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.