Description Usage Arguments Value Examples
View source: R/fars_functions.R
This function uses the maps
package to display dots for each incident on a map of a given state over
a given year. It takes as inputs the state, represented by its number with all states ordered alphabetically,
and year. The filter
function from the dplyr
package is used to consolidate the data
1 | fars_map_state(state.num, year)
|
state.num |
an integer from 0 through 51, representing each state and the District of Columbia |
year |
An integer representing a year that is 2013, 2014, or 2015 |
A map of the state with each dot representing an incident. If there are no accidents in that state in the given year, the function returns a message as such. If a number is input that does not correspond to a state, the function returns a message that the provided state number is invalid
1 2 3 4 5 | ## Not run:
fars_map_state(5, 2013)
fars_map_state(51, 2014)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.