fars_summarize_years: Group the number of incidents per month in a given year

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function returns the total number of incidents per month in a given year. The only input is the year the user wishes to evaluate, and the dplyr package's bind_rows, group_by, and summarize functions and the tidyr package's spread function are all used to aggregate the individual datapoints into a table of months and incidents per month

Usage

1

Arguments

years

An integer representing a year that is 2013, 2014, or 2015

Details

makes use of the fars_read_years function, which uses the make_filename and fars_read functions, to first make a matrix of the same number of rows as the primary datafile, then to add the relevant incident data to each row, and then finally to summarize each month

Value

A table with the total number of incidents in each individual month of the given year

Examples

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

## End(Not run)

MikePJones/Week4Proj documentation built on May 17, 2019, 2:46 p.m.