fars_summarize_years: Read in and summarise FARS data for a specified range of...

Description Usage Arguments Details Value Examples

Description

The fars_summarize_years function is used to read in FARS data from a specified range of years and return the monthly number of accident registered in FARS.

Usage

1

Arguments

years

A year or a vector of years (in any class that can be coerced to numeric) to specify which FARS reports are to be read in

Details

The function internally uses the fars_read_years function to read in and extract the data and then uses dplyr and tidyr functions to summarise and reformat the data.
Like fars_read_years it reads the data from your working directory and it will produce a warning if an invalid year is given as input. Please be aware that the standard naming convention for FARS data has to be used (cf. make_filename).

Value

This function returns a tbl_df object with one column for every year analysed and twelve rows, one for each month. The columns contain the sum of accidents reported to FARS in each month of the given year.

Examples

1
## Not run: fars_summarize_years(2013:2015) #Summarize FARS data for the years 2013, 2014 and 2015

tdo15/fars documentation built on May 3, 2019, 10:45 p.m.