fars_summarize_years: Print "FARS Summarize Years"

Description Usage Arguments Value References See Also Examples

View source: R/fars_functions.R

Description

fars_summarize_years lists the number of fatal injuries suffered in motor vehicle accidents in each month for a specified list of years. The data is compiled by the Fatality Analysis Reporting System (FARS) of the US National Highway Traffic Safety Administration.

Usage

1
fars_summarize_years(years, dir = "./inst/extdata")

Arguments

years

a list of years (each represented as 4-digit integers or character strings) for which data is desired

dir

a character string containing the directory that contains the FARS data

Value

The function returns a tibble data frame (class tbl_df, as defined by the dplyr package) with twelve rows, each corresponding to a month of the year. Columns correspond to different years and data values represent the number of fatalities for each year and month.

References

https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars

See Also

fars_read_years, fars_read

Examples

1
2
3
4
dir <- system.file("extdata",package="msdr3pam")
fars_summarize_years(c(2013,2014,2015),dir=dir)
fars_summarize_years(c('2013','2015'),dir=dir)
fars_summarize_years(list('2014','2015'),dir=dir)

mmiesch/msdr3pam documentation built on May 18, 2019, 9:14 p.m.