Description Usage Arguments Value Examples
Takes input of a state.num and year as arguments and plots the
accidents onto a map of the states. If the state number is invalid, an error is thrown.
If there are no accidents in that state, a message is returned that there are no
accidents to plot.
1 | fars_map_state(state.num, year)
|
state.num |
A numerical integer denoting the US state as is shown in the data set |
year |
A numerical integer denoting the year |
Returns a plot of states with the number of accidents on each states
the accidents based on the year. Returns an error if state.num or if
year do not exist in the data set.
1 2 3 4 5 6 7 8 9 | ## Not run:
fars_map_state(20, 2013)
fars_map_state(10, 2014)
fars_map_state(30, 2016)
fars_map_state(72, 2013) #Error because \code{state.num} doesn't exist
fars_map_state(20, 2020) #Error because \code{year} doesn't exist
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.