Description Usage Arguments Details Value Examples
View source: R/fars_functions.R
The function takes the state number and year as an input, and plots the accidents on the US map.
1 | fars_map_state(state.num, year)
|
state.num |
Numeric or integer value representing the state of the US as per the FARS data. |
year |
Numeric or integer value representing the year of the accidents. |
The state number must be an integer or numerical and must exist in the FARS data, otherwise the functions terminates with an error. Also returns an error if the data file for the year input does not exist. Finally, returns an error if the state or year does not exist in the data set.
The function requires the use of the dplyr, maps and graphics libraries.
Returns a plot of the US containing the accidents based on the state and year.
1 | fars_map_state(34, 2014)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.