fars_read_years: Read FARS files for one or more years.

Description Usage Arguments Details Value Examples

Description

fars_read_years produces a list of tibbles of FARS data, given an input vector of years.

Usage

1

Arguments

years

Vector of years' FARS files to open. Vector members must be an integer, or a string or numeric that can be coerced to a string, of the year of interest.

Details

This function takes a vector of years and produces a list of tibbles, where each tibble is that year's FARS file year and MONTH observations. This is a simple function that strips all useful data out of the FARS tables and produces a completely useless tibble, but is meant for practice in the Coursera course. For this function to work, valid years should be entered. Invalid years will have a NULL entry in the returned list.

Value

This function returns a list of tibbles, where each tibble contains containing the year and month from the observations in the corresponding year's FARS data. If an invalid year is given, the corresponding list will be NULL.

Examples

1
2
3
4
5
6
7
fars_read_years(years = c(2013, 2014, 2015))
fars_read_years(years = 2013)

## Not run: 
fars_read_years(years = 2000) # error

## End(Not run)

nayak-neelavara/FARSProject documentation built on May 8, 2019, 3:14 a.m.