Description Usage Arguments Details Value Note Examples
View source: R/fars_functions.R
The function graphically displays the locations of fatal accidents recorded in the US National Highway Traffic Safety Administration's Fatal Analysis Reporting System (FARS). The function accepts a state number and year as parameters.
1 | fars_map_state(state.num, year)
|
state.num |
State number |
year |
A vector (or matrix) used to represent the years of the data files to be imported. |
The function uses the following previously described functions in this package;
make_filename(), fars_read. The function accepts a state.num
argument and state.num
argument to plot
incidents for a given year. Execution will halt if the state number does not exist and return the message
invalid STATE number: " x (where x is the state.num
argument). If there are no fatalities in a state the
function returns 'no incidents to plot'.
This function returns a plot depicting the location of fatal incidents (where a death occured within 30 days of the crash) recorded during a given year for a state.
The dplyr,map and point packages must also be installed in the R environment but do not have to be attached.
1 2 3 4 5 6 | fars_map_state (1,2013)
## Not run:
fars_read_years(c(2013,2014))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.