fars_read_years: fars_read_years

Description Usage Arguments Details Value References Examples

View source: R/fars_functions_LCP.R

Description

A function to extraxct monthly data from a given set of years.

fars_read_years This function uses an user provided series of years to extract their FARS monthly data

Usage

1

Arguments

years

Is a numeric vector corresponding to the series of years for which you want to extract monthly data.

Details

For each year provided in the numeric vector argument to the function, the make_filename function from this package generates its corresponding filename. The data from each file will then be extracted using the fars_read function from this package. Subsequently, the monthly data is subsetted by means of the dplyr functions mutate and select. The functions evaluates the code and assigns a warning handler to years for which data are not available.

Value

A list of subsetted dataframes in dplyr format with the monthly data from every year included in years.

References

https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars

Examples

1
2
3
4
5
6
7
8
## Not run: 
fars_read_years(c(2013,2014,2015))

## End(Not run)
## Not run: 
fars_read_years(c(2016,2017))

## End(Not run)

Darwinita/FARSpackageLCP documentation built on May 27, 2019, 4:06 a.m.