fars_read_years: Read FARS data files.

Description Usage Arguments Details Value Examples

Description

This is a custom readr_csv function that reads a FARS data file given their corresponding years.

Usage

1

Arguments

years

A vector of integrs, or other types coerced to intgers, represent the years of the FARS data files.

Details

The function returns a warning invalid year: year if the input year does not correspond to one of the files in the current working directory. othewise construct a vecotr of file names using make_filename and reads them in a list using fars_read.

Value

A list of data.frames, each of its elements correspond to one of the inpute years.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# invalid input, year doesn't exist
fars_read_years(c(2013, 2014, 1900))

# valid input
fars_read_years(2013:2015)

## End(Not run)

MahShaaban/fars documentation built on May 8, 2019, 3:21 p.m.