fars_read_years: Reads month and year from accident files using dplyr

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function accepts as an input a vector or list of years and returns a list of data frames with MONTH and year columns based on the data loaded from "accident_<year>.csv.bz2" files.

Usage

1

Arguments

years

A vector or list of years in numeric or integer format.

Details

The files need to exist in the working directory. Returns NULL and a warning if the file does not exist.

The function requires the use of the dplyr library.

Value

Returns a list of tibbles with the same number of rows as the "accident_<year>.csv.bz2" files and two columns (MONTH and year).

Examples

1
2
fars_read_years(2013:2015)
fars_read_years(list(2013, 2015))

MarcEres/FarsFinal2 documentation built on Dec. 17, 2021, 2:20 a.m.