Description Usage Arguments Value Examples
View source: R/fars_functions.R
Import data for multiple years
1 | fars_read_years(years)
|
years |
The list or vector of four-digit years for which you want to import information. |
This function returns a list in which each element corresponds to an element in the argument "years." For each valid year in "years," the corresponding element of the list will be a tibble with rows equal to the number of observations and two columns: MONTH and year.
If an invalid year
is provided as an argument, the corresponding element of the returned list
will be NULL. A warning message will then print: Warning message: In
value[[3L]](cond) : invalid year
1 2 3 4 5 6 7 | fars_read_years(2014)
fars_read_years(c(2013, 2014))
fars_read_years(c(2013, "invalid input"))
Note that if input contains both valid and invalid years, the function will
successfully process the valid years while still returning \code{NULL} and giving
out a warning for invalid years.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.