fars_summarize_years: Count the number of accidents per month

Description Usage Arguments Details Value Note See Also Examples

Description

Using a list of years as input, this function reads the collect the available data in the Fatality Analysis Reporting System dataset. It then counts the number of accident per month.

Usage

1
fars_summarize_years(years,fars_path)

Arguments

years

a list of values corresponding to year

fars_path

charcter string correspondinf to the directory containing the fars data

Details

Uses fars_read_years then transforms the list into a data.frame. The data is aggregated by the MONTH and year columns and summerize with the count n() function.

Value

a data frame table with columns

Note

See Also

fars_read_years

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# need to be in the same directory as the data
setwd("data")
# with one year
fars_summarize_years(2013)
# with multiple years
fars_summarize_years(2013:2015)
# with characters
fars_summarize_years(c("2013","2015"))

## End(Not run)

BreizhZut/Fars documentation built on May 27, 2019, 2:04 p.m.