fars_read_years: Read year and month columns of multiple years worth of FARS...

Description Usage Arguments Value Note Examples

Description

This function reads the month and year columns of multiple single-year FARS data files into R for analysis. It is mostly useful as an input of the fars_summarize_years function.

Usage

1

Arguments

years

a vector of integers representing the year values to be read. Each value must correspond to a year with a CSV file in the working directory that can be read.

Value

a list of data frames, each containing the year and month columns of the raw data for each year in the input

Note

This function will return warnings if any years are input that do not correspond to CSV files saved with the correct filename syntax (accident_(year).csv.bz2) in the working directory. Instead of a data frame containing data from the file, it will input a NULL value for the corresponding list element and generate the following warning: In value[[nL]](cond) : invalid year: YYYY

Examples

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

expo45/wk4project documentation built on May 16, 2019, 9:56 a.m.