fars_summarize_years: Summarize how many accidents happend in each month by year

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function summarizes the number of occurrencies in each month by year.

Usage

1

Arguments

years

a vector with all years that should be loaded

Details

This function uses bind_rows, group_by and summarize functions from dplyr package and spread function from tidyr package. It also calls fars_read_years function in order to select only month column from each year. In case the year required doesn't have a correspondent file it will generate a warning.

Value

This function returns a dataframe summarizing the numer of accidents in each month of each year. if the year required is invalid a warning will be generated to inform it.

Examples

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

## End(Not run)

TarsoRodriguez/fars documentation built on May 17, 2019, 2:46 p.m.