fars_summarize_years: Summarize Monthly Accident Totals

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This is a function that takes a set of years and, for each year, returns a tibble showing the total number of accidents recorded in each month of that year.

Usage

1

Arguments

years

The list or vector of four-digit years for which you want to import information.

Details

For this function to work properly, a year must be provided that corresponds to a year of data in a properly-named spreadsheet in the working directory. If the year is not valid or the spreadsheet is not in the directory, the function will return an error.

Value

This function returns a tibble with 12 rows - one corresponding to each month of the year - and one column, titled by the four-digit year, for each valid year provided in the argument plus an additional column MONTH listing the months in the data from 1-12.

Each column named with a year shows the total month-by-month accident reports for each month of that year.

Examples

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

## End(Not run)

kevin444/RpackageCoursera documentation built on June 29, 2020, 12:54 a.m.