Description Usage Arguments Details Value Examples
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:
https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars
https://en.wikipedia.org/wiki/Fatality_Analysis_Reporting_System
1 | fars_summarize_years(years)
|
years |
A vector or list of years to summarize by. |
Gives warnings if one or more, but not all years are invalid; throws an error when all years are invalid
A data frame (tbl_df) with number of accidents by years summarized by month.
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)})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.