fars_summarize_years: Return a monthly summary of the FARS for a range of years

Description Usage Arguments Details Value Note Examples

View source: R/fars_functions.R

Description

This function returns a monthly comparison of the number of accidents in each year.

Usage

1

Arguments

years

A list or vector of years to compare

Details

The accident report CSV for each year is read using fars_read_years, a summary of the counts is created using dplyr::summarize, and the data is then converted into a wide table for easier comparison using tidyr::spread.

Value

A dataframe of the accident counts for each month of each request year. There is a column per year, and a row for each month.

Note

Invalid years will be ignored, and a warning message will be printed.

Examples

1
2
3
4
## Not run: 
fars_summarize_years(2013:2015)

## End(Not run)

wesen/coursera_fars documentation built on May 18, 2019, 4:52 p.m.