fars_read_years: Read in FARS data for a specified range of years

Description Usage Arguments Details Value Examples

Description

The fars_read_years() function is used to read in FARS data for a specified range of years.

Usage

1

Arguments

years

A year or a vector of years (in any class that can be coerced to numeric) to specify which FARS reports are to be read in

Details

The function internally uses the make_filename function to create standardised file names from the years input. It then reads in CSV files from the working directory that correspond to this standardised file name and uses dplyr functions to reorganise the data.

Value

This function returns a list of FARS data where every list entry contains the data for one of the years specified in form of a tbl_df. The data frame has one line for every data point in the respective FARS data set and indicates the month and the year for this data point.
It produces an error warning if an invalid year is given as input.

Examples

1
## Not run: fars_read_years(c(2014, 2015)) #Read in FARS data for 2014 and 2015

tdo15/fars documentation built on May 3, 2019, 10:45 p.m.