Description Usage Arguments Details Value Examples
This is a simple function that, given a filename, opens the data and returns it in a dataframe. Throws an error if the filename is invalid.
1 | fars_read(filename)
|
filename |
A character string giving the source file the function will read |
The function uses imported readr::read_csv()
to open the file and
dplyr::tbl_df()
to coerce the dat into a tibble object.
This function returns the FARS data in a tibble dataframe.
1 2 3 4 | library(readr)
my_file <- system.file("extdata", "fars_data.zip", package = "fars")
unzip(my_file, junkpaths = TRUE)
fars_read("accident_2013.csv.bz2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.