fars_read_years: Read multiple FARS data files, retaining only the month and...

Description Usage Arguments Details Value Examples

Description

This function reads the FARS file for each of the years in the years list argument, retaining only the MONTH and year of the FARS reports in a list containing one data.frame per year.

Usage

1

Arguments

years

A list of 4-digit year numbers (YYYY) specifying the FARS files to be read.

Details

The function will produce a warning and skip the year if there is no FARS data file, or the data file cannot be read, for any of the given years.

The following functions are imported: dplr::mutate, dplr::select.

Value

This function returns a list of data.frames, one per year, in which each observation reflects the month and year of an accident report.

Examples

1
2
3
4
#warns of an invalid year
fars_read_years(list(2015,2019))

fars_read_years(list(2013,2014))

dmendres/farsAssignment documentation built on May 15, 2019, 9:20 a.m.