fars_read_years: Read FARS data of multiple years

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function is for reading FARS data of multiple years. You can provide a vector of years which will be converted to appropriate file name using make_filename. After that, function will attempted to read each file name. If filename does not exist, warning will be shown and NULL will be returned for that years data.

Usage

1
fars_read_years(years, fname_transform = identity)

Arguments

years

a vector of years (will be coerced to integer)

fname_transform

a function to be applied to filename that make_filename contructs, default is identity which does not change filename. This is helpful in cases where you want to add custom path prefix to all filenames.

Details

If data for a year does not exist, returning list will have NULL value associated with it

Value

list of dataframes containing data for each year. names of the list will be years and their corresponding values will have data for that year.

Examples

1
2
3
4
## Not run: 
fars_read_years(2013:2015)

## End(Not run)

nirmalpatel/farsdata documentation built on Aug. 7, 2019, 2:55 a.m.