fars_summarize_years: Display a count of the number of fatalities per month and...

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

This function counts the number of traffic fatalities per month/year for the vector of years specified in argument years.

Usage

1

Arguments

years

A vector of years for the files you're interested in.

Details

This function makes use of the fars_read_years() function, which in turn makes use of fars_read() which uses make_filename(). First, the list of tibbles returned by fars_read_years() is unioned and then grouped by year and month. Then dplyr::summarize() is used to count the number of fatalities in each year/month group. Finally, tidyr::spread pivots the counts so that they're visually appealing for printing.

Value

This function returns a tibble.

Examples

1
fars_summarize_years(c(2013, 2014, 2015))

john-s-christensen/fars documentation built on May 17, 2019, 3 p.m.