Description Usage Arguments Details Value Examples
This function creates a map of accident locations within the specified state
(state.num
) and year
.
1 | fars_map_state(state.num, year)
|
state.num |
An integer corresponding to a specific state. Indicates which state to map |
year |
An integer or character string giving the year for the filename |
This function requires both the maps
and
graphics
packages.
If state.num
is not within STATE column (1-50 corresponding to 50 states
in alphabetical order), will return error: "invalid STATE number:"
.
If there are no accidents within the specific state.num
and year
,
function will return message: "no accidents to plot"
.
If year
is not contained within the datasets (2013, 2014, or 2015),
the function will return a warning: "invalid year:"
.
This function returns a graphic plot of the accident locations within
a specified state (state.num
) and year
. Points indicate accident
locations and solid lines indicate state boundary.
1 2 | ## Not run: fars_map_state(1,2013)
## Not run: fars_map_state(20,2014)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.