fars_read_years: Read the dataset for multiple years

Description Usage Arguments Value Examples

Description

This function builds on the functionality of make_filename and fars_read to read the data from multiple CSV files containing the data for the years corresponding to the input years. The dplyr functions mutate and selectare used to tidy the data and only return the 'MONTH' and 'year' variable collumns respectively. The base R functiontryCatchis used to catch errors created by make_filename and show these errors and the end of running without interrupting the execution of the base R function lapply.

Usage

1

Arguments

years

A vector of numbers or character strings representing years.

Value

This function returns a list (the same length as years) of tibbles. NULL is returned for each input year not corresponding to a valid dataset.

Examples

1
2
3
4
5
6
## Not run: 
fars_read_years(2013)
fars_read_years(c("2013","2014"))
data <- fars_read_years(2013)

## End(Not run)

supervan2/Testy documentation built on May 17, 2019, 2:47 p.m.