Description Usage Arguments Value Note Examples
This function loads data from FARS data files and puts them in a list of tibbles, year by year.
1 | fars_read_years(years)
|
years |
a vector or a list with years |
a list with data tibbles year by year
Missing data for any of the requested years will
result in a warning and a NULL
in a coresponding
place in a return list. Set the working directory before running
this function.
1 2 3 4 5 6 7 8 9 10 | # good years, but bad path
fars_from_2013_to_2015 <- fars_read_years(2013:2015)
fars_from_2013_to_2015
# the directory with data files must be a working directory
setwd("data")
fars_from_2013_to_2015 <- fars_read_years(2013:2015)
str(fars_from_2013_to_2015)
# invalid range results in NULLs
fars_from_2010_to_2013 <- fars_read_years(2010:2013)
str(fars_from_2013_to_2015)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.