fars_summarize_years: Summarize FARS accident data by month and year;

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

Summarize the Fatality Analysis Reporting System data, counting the number of accidents per month over the stated set of years.

Usage

1

Arguments

years

Character/numeric vector containing the years to summarize.

Details

Do note that the following packages are needed: dplyr, tidyr, readr, magrittr, and purrr.

Value

A tibble containing a summary with the years as columns and month as rows. The values are the number of accidents for that year's month.

Examples

1
2
3
4
5
#setwd(system.file("data-raw", package = "wk4package"))
# Returns a table with the number of accidents for every month in 2013 and 2014.
## Not run: fars_summarize_years(c(2013, 2014))
# Character objects work too
## Not run: fars_summarize_years(c("2013", "2014"))

SamHall14/wk4package documentation built on Dec. 18, 2021, 12:56 p.m.