fars_summarize_years: FARS summarize years.

Description Usage Arguments Details Value Depends on Examples

View source: R/fars_functions.R

Description

Summarizes the number of fatal injuries suffered in motor vehicle traffic crashes by month for each provided year.

Usage

1

Arguments

years

A vector containing the years of interests as integer or character.

Details

This function performs the steps below:

  1. Read the FARS data files in R as a data frame tables for provided years (using fars_read_years).

  2. Bind all of the data frame tables by row into one data frame table (see bind_cols).

  3. Summarize the number of incidents by year and MONTH.

Value

A data frame table (see tbl_df in the dplyr package).

Depends on

  1. bind_rows, group_by and summarize in the dplyr package.

  2. spread in the tidyr package.

Examples

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

## End(Not run)

pparacch/fars documentation built on May 6, 2019, 6:01 p.m.