fars_read_years: Read data for specified year(s)

Description Usage Arguments Details Value Examples

Description

This function reads a file for a specified year, uses the year to create a column name, selects the year and month columns, and returns a list of the resulting data frames.

Usage

1

Arguments

years

A vector specifying the year(s) (YYYY format).

Details

This function takes the year input and iterates it over another function that selects and wrangles the data for a given year. Inside this second function, make_filename is called to create a data file name for the desired year. Then, fars_read is called to import the data, which is then processed such that the year of the associated data is given to the year column and only that column and month are selected. If a year is chosen that is not correspond to a valid file name, an error will be thrown indicating an invalid year was specified.

Value

This function returns a list of the data and selects the month and year columns.

Examples

1
2
fars_read_years(2013)
fars_read_years(c(2014, 2015))

jrwinget/Rfars documentation built on May 17, 2019, 12:11 a.m.