fars_read_years: Select the month and year columns from the files whose years...

Description Usage Arguments Details Value Note Examples

View source: R/fars_functions.R

Description

This function is used inside of the fars_summarize_years() function and input for the years argument comes from the years argument of the fars_summarize_years() function.

Usage

1

Arguments

years

A vector of years for the files you're interested in.

Details

This function takes a vector of years as input and uses lapply() to make a filename for each year, read in that file as a tibble and select the month and year columns in that tibble.

Value

This function returns a list, with each element of the list being a tibble for each year in the vector of years specified in argument years. Each tibble in the list contains two columns, "MONTH" and "year".

Note

if even one of the years in the vector passed to argument years does not exist (if there is no file for that year), no results, only an error message, will be returned; "invalid year: 2017" for example.

Examples

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

john-s-christensen/fars documentation built on May 17, 2019, 3 p.m.