Description Usage Arguments Details Value See Also Examples
View source: R/fars_functions.R
'fars_summarize_years()' produces a summary statistic of the fatal traffic crash data compiled by the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS). The function lets you count monthly totals of fatal traffic accidents on an annual basis.
1 | fars_summarize_years(years)
|
years |
a numeric vector of four digit numbers represents years in the format 'YYYY' |
See here for more information about FARS|NHTSA.
a summary or pivot table of monthly total values, generated by pivoting a tibble wider, with rows by months and columns by years; An invalid value (year) specified in the input will cause a NULL value generated while reading data from corresponding file, missing value (column) for the invalid year in the output, and a warning message "invalid year: ...". Completely invalid input will cause a "Must group by variables found in '.data'" error in addition to warning messages of "invalid year: ..."
fars_read_years
which this function wraps
1 2 3 4 5 6 7 8 9 | ## Not run:
fars_summarize_years(c(2013,2014,2015))
## End(Not run)
## Not run:
yrs <- 2013:2015
monthly_counts <- fars_summarize_years(years=yrs)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.