Description Usage Arguments Details Value Examples
The function plots a map that shows where in the specified state the accidents occurred during the specified year.
1 | fars_map_state(state.num, year)
|
state.num |
State number |
year |
Year of interest |
Internally, the function uses make_filename
and
fars_read
functions to load the data, filters by state and plots
accidents using the map function of the maps package. Only one state
and one year can be specified in the function call. If the user enters wrong
state number, the function will abort, throwing out an error. If the user filters
out all of the data, the function will print an appropriate message.
The function plots a map of the state with points representing locations at which the accidents occurred.
1 2 3 4 | ## Not run:
fars_map_state(10, 2014)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.