fars_summarize_years: Count the number of accidents within each month for each year

Description Usage Arguments Value Examples

Description

This is a simple function that takes a list of numerical integers, each element of which denotes a year, and produces a data frame with the number of accidents for each month within each year.

Usage

1

Arguments

years

A list/vector of integer numbers, each of which denote a year.

Value

Returns a pivot data frame containing two columns (one for accident count, and one for each year in the years list/vector), where each month is a row. As per use of the fars_read_years function, a warning will be returned if an element of years does not have an associated file.

Examples

1
2
3
4
5
6
## Not run: 
fars_summarize_years(2013)
fars_summarize_years(2013:2014)
fars_summarize_years(list(2013, 2014, 2015))

## End(Not run)

swethagarimalla/FARS documentation built on May 24, 2019, 7:16 a.m.