Description Usage Arguments Value Note Examples
This function generate a map of all FARS events in one or more US states, with each event displayed as a dot on the map. User may specify the state(s) by unique ID# and year from which FARS event data should be drawn.
1 | fars_map_state(state.num, year)
|
state.num |
An integer vector that uniquely identifies one or more US states in the FARS dataset |
year |
An integer representing the year that will be inserted into the file name |
Returns map plot of one or more US states with black dots representing FARS events in the selected year
This function throws an error if an invalid year
is selected (not a number or not a year in the available dataset(s))
It also throws an error if an invalid state.num
is specified
More than one state may be selected at a time, generating a country-wide map with data plotted for selected states
If a valid subset of data is selected, but not FARS events are avaialble, the function will print a message indicating that
1 2 3 | ## Not run: fars_map_state(1, 2013)
## Not run: fars_map_state(1:50, 2013)
## Not run: fars_map_state(75, 2013)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.