fars_read_years: Pre-format dataframe for selection

Description Usage Arguments Details Value Errors See Also Examples

View source: R/fars_functions.R

Description

Pre-format dataframe for selection

Usage

1

Arguments

years

a list of years

Details

This function takes a list of years and attempts to read the FARS data file into a data frame for each year. The year is then appended as a column to each data frame, Then it along with the MONTH column are extracted. The result is a 2-column data frame with the same number of rows as the original FARS data for that year containing the MONTH column from the FARS data and the year of the data file.

This function must be called from the directory where the data is located.

This function requires dplyr

Value

a list of tribbles with two columns, MONTH and year

Errors

This function will raise an error if a FARS-formatted file for that year cannot be located in the current directory

See Also

fars_summarize_years()

Examples

1
2
3
4
## Not run: 
years <- fars_read_years(list(2013, 2014))

## End(Not run)

csprock/myRpackage documentation built on Nov. 30, 2021, 8:03 a.m.