Description Usage Arguments Details Value Examples
View source: R/fars_functions.R
This function produces a monthly count of the number of accidents in the FARS database for each year
given in years
.
1 | fars_summarize_years(years)
|
years |
A vector of four-digit years of the FARS data to load. Currently only data from 2013-2015 are available.
|
The FARS data can be found at the National Highway Traffic Safety Association
here.
2013-2015 data is distributed with this package. The location of the files can be found using
system.file('extdata',package='FARScoursera')
These files need to be in your working directory for this function to work correctly.
This function returns a dplyr tibble with the month in rows and the year in columns.
The entries are the total number of accidents in that year / month. If years
is a mix
of valid and invalid years, the tibble is still returned by with warnings. If years
does not contain any valid years, then an error is thrown
1 2 | ## Not run: fars_summarize_years(c('2013','2014'))
## Not run: fars_summarize_years(2013:2014)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.