Description Usage Arguments Details Examples
This function takes the number of a state and the number of a year and plots all accidents from the FARS data set which happened during the given year in the given state. Each accident is represented by a point on a map of the given state.
1 | fars_map_state(state.num, year)
|
state.num |
the index number of a state |
year |
the number of a year |
This function returns NULL, but as a side effect the state map as described above is plotted.
This function throws an error if the given state number does not occur in the FARS data set.
Errors may also be thrown by calls to the plotting functions, such as
maps::map("state")
. This happens, for example when calling
fars_map_state(2, 2013)
.
One reason for errors could be missing data in the requested data set. This function implicitly sets missing longitudes to 900 and missing latitudes to 90. These values may be outside the bounds of the state map and therefore cause plotting to throw errors.
1 2 3 4 | ## Not run:
fars_map_state(1, 2013)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.