Description Usage Arguments Details Value Note Examples
fars_read_years
is a function that reads Fatality Analysis Reporting System (FARS)
data for multiple years.
1 | fars_read_years(years)
|
years |
A vector of years. |
This function processes each element of a vector or list of years. To generate a
file name with the year this function calls the supporting function make_filename()
,
and then calls the supporting function fars_read()
, to read the FARS data file
with the generated file name. If the file exists, the function creates a new column
(year), then selects the month and year columns, and adds them to an R list.
A list of FARS data for the years in the parameter years
.
If the file doesn't exit, the function gives a warning message, and adds nothing (NULL) to the list.
1 2 3 4 5 | ## Not run:
fars_read_years(c(2014, 2015, 2016))
fars_read_years(c("2014", "2015", "2016"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.