fars_summarize_years: Summarise FARS data by years

Description Usage Arguments Details Value Examples

Description

This function gives the number of fatal in injuries in car accidents by year and month. The data is from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS), which is a nationwide census, providing the American public yearly data, regarding fatal injuries suffered in motor vehicle traffic crashes. For more information, see:

Usage

1

Arguments

years

A vector or list of years to summarize by.

Details

Gives warnings if one or more, but not all years are invalid; throws an error when all years are invalid

Value

A data frame (tbl_df) with number of accidents by years summarized by month.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fars_summarize_years(2013)
fars_summarize_years(2013:2015)

# gives warning
fars_summarize_years(2012:2013)

# throws an error
year = 2010
tryCatch({fars_summarize_years(year)},
  error = function(e) { warning("invalid year: ", year)
  return(NULL)})

KvEijden/FARS documentation built on June 11, 2019, 1:30 p.m.