fars_read_years: Read in files by year

View source: R/fars_functions.R

fars_read_yearsR Documentation

Read in files by year

Description

This function takes a list of years and creates file names for each of them using the make_filename function. It then reads in these files using the fars_read function and creates a list of tibbles which contain the months in each of the years. If the file name created from a year inputted does not correspond to an existing file containing data for said year, an error is thrown.

Usage

fars_read_years(years)

Arguments

years

A list or vector of years.

Value

A list of tibbles, each with two columns: one containing the months, and the other containing the year. The number of rows for each month represents the number of accidents in the month. This list is also printed.

Examples

## Not run: fars_read_years(c(2014,2015))
## Not run: fars_read_years(c(2013,2014))


haliyan/fars.functions documentation built on May 9, 2022, 8:30 p.m.