Description Usage Arguments Details Value Note Examples
This function produces a graphical map of the state and shows the location of motor vehicle fatalities in the year. The map is then auto plotted to the plot window.
1 | fars_map_state(state.num, year)
|
state.num |
The state number as integer, or character to be coerced |
year |
The year as an integer |
The data for the year is first read in and a check is made to determine if state data exists. If this data is available it is filtered and, if accidents have occurred, their locations are plotted on the state map. If NA's exist in the LONGITUD or LATITUDE columns they are imputed.
A plot rendered and shown
Year cannot be vectorized or this function will produce an error
If the state number is invalid or doesn't exist in the data this function will produce an error
If there are no accidents in the state, a message will be produced and no plot will be rendered
1 | fars_map_state(1,2015)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.