Description Usage Arguments Value Note Examples
This function reads the month and year columns of multiple single-year FARS data files
into R for analysis. It is mostly useful as an input of the fars_summarize_years
function.
1 | fars_read_years(years)
|
years |
a vector of integers representing the year values to be read. Each value must correspond to a year with a CSV file in the working directory that can be read. |
a list of data frames, each containing the year and month columns of the raw data for each year in the input
This function will return warnings if any years are input that do not correspond
to CSV files saved with the correct filename syntax (accident_(year).csv.bz2
) in
the working directory. Instead of a data frame containing data from the file, it will
input a NULL
value for the corresponding list element and generate the following
warning: In value[[nL]](cond) : invalid year: YYYY
1 2 | ## Not run: fars_read_years(c(2013, 2014, 2015))
## Not run: fars_read_years(2013)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.