fars_read_years: Import data for multiple years

Description Usage Arguments Value Examples

View source: R/fars_functions.R

Description

Import data for multiple years

Usage

1

Arguments

years

The list or vector of four-digit years for which you want to import information.

Value

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

Examples

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.

alexmjn/advancedr documentation built on May 29, 2019, 5:57 p.m.