Description Usage Arguments Value Examples
This is a simple function that takes a numerical list of integers that
denotes years
, accesses the accident file for each year
of the list of
years
and return a list of dataframes of MONTH
and year
, one
for each accident file, each associated with a year. The accident files for each year
within list must be located within the current working directory and must be named in
the format 'accident_<year>.csv.bz2'
1 | fars_read_years(years)
|
years |
A list of integer numbers, each of which denote a year. |
Returns a list of dataframes/tibbles of months (under the column 'MONTH') and
years (under the column 'year'). Each of these tibbles is associated with each accident
file that is associated with each of the year
elements of the list of years
.
If a year
within the list does not have an associated file in the current working
directory named in the format 'accident_<year>.csv.bz2', then a warning is thrown and returns
NULL.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
fars_read_years(2013)
fars_read_years(list(2013, 2014))
fars_read_years(2013:2015)
#A not-found warning is thrown and null is returned for the following
fars_read_years(list(2013, 2014, 2015, 2016))
fars_read_years(2017)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.