fars_summarize_years: Summarize FARS data by month and year

Description Usage Arguments Value Examples

Description

Designed to load multiple years of FARS csv data and show the total number of fatal road incidents by month (rows) and years (columns). The FARS csv files you intend to read must be in your working directory otherwise the function will give you a warning: invalid year. The code for this function is part of the Building R Packages course sourced from coursera. Requires the dplyr and tidyr packages to be loaded. Example data is only available for 2013:2015.

Usage

1

Arguments

years

A vector of the years you'd like to collect data for

Value

A summary data.frame showing the total number of fatal road incidents by month / year.

Examples

1
2
3
4
5
6
7
8
## Not run: 
  setwd("data")
  years <- 2013:2015
  df <- fars_summarize_years(years)
  print(class(df))
  print(head(df))

## End(Not run)

simongarisch/R-Packages-Week-4 documentation built on May 29, 2019, 9:36 a.m.