Description Usage Arguments Value
This function modifies the dataframe from a csv file read into R.
The csv file is of the form "accident_2013.csv.bz2", where 2013 is the year
of interest. The new dataframe has variables month and year. The single
argument is years, a list of years such as list(2013,2014,2015)
.
The function uses lapply to loop through the list of years to create
the new dataframe. The function calls the internal function make_filename(year)
to get a file name and the internal function fars_read(file)
to read
the csv file into R. An error is generated if the year does not exist or
if the file does not exist
1 | fars_read_years(years)
|
years |
a list of years such as |
function returns a list of dataframes or NULL if the available files do not include the year of interest.
examples \donotrun dat_list <- fars_read_years(list(2013,2014,2015))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.