fars_read_years: Read in multiple files by year

Description Usage Arguments Details Value Note Examples

Description

fars_read_years takes a vector of years it iterates over them to create filenames to read in and return with only the MONTH and year columns selected

Usage

1

Arguments

years

A vector of years to read in

Details

The function will create a filename depending on the year input, if the file does not exist an error will be thrown. If it does exist, it will attempt to read them in, mutate a new column with the year and then select the columns MONTH and year.

Value

returns a list of dataframes with columns MONTH and year, NULL when an error is encountered

Note

this function depends on dplyr mutate and select functions

Examples

1
2
3
4
## Not run: 
  fars_read_years(c(2013, 2014))

## End(Not run)

ZeroStack/week2 documentation built on May 10, 2019, 1:57 a.m.