Description Usage Arguments Value Note Examples
This function produces a map with a plot of the location of all FARS incidents in a given state during a given year.
1 | fars_map_state(state.num, year)
|
state.num |
An (integer) state identification number as listed in the FARS data files. |
year |
An integer value corresponding to the year for which the map should be plotted. |
a plot showing the location (latitude and longitude) of all FARS incidents, plotted on a map of
the state identified by state.num
during the specified year
.
This function will stop and return the message "invalid STATE number: state.num"
if a state.num
value that does not correspond to a state listed in the data file is input.
This funciton will stop and return the message "no accidents to plot"
if there are no FARS
incidents in the specified state during the specified year.
This function will result in an error if the year
specified does not correspond to a
FARS CSV file in the current working directory with the proper filename syntax (accident_YYYY.csv.bz2
)
1 | ## Not run: fars_map_state(6, 2014)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.