fars_read_years: Reads a FARS file for a given vector of years.

Description Usage Arguments Details Value Examples

View source: R/fars.R

Description

Reads a FARS file for a given vector of years.

Usage

1

Arguments

years

A numeric vector of years corresponding to FARS file by year. It also accepts a charcter vector and converts to numeric.

Details

fars_read_years function imports the FRAS file for a given vector years, and it uses make_filename to create the correct file name associated with years.And then imports the file using fars_read function, and then adds(mutates) a varaible year. Then selects and displays two variables MONTH, year.

Value

It returns a list of data frame with two columns and where each list is for the input years. The two columns are MONTH and year. If the file for the given year is not found, it returns a list of NULL with a warning message of invalid year: years.

Examples

1
2
3
year_input<-c(2013,2014,2015)
fars_read_years(2015)
fars_read_years(year_input)

hahustat/farsdata documentation built on Sept. 29, 2020, 12:48 a.m.