Description Usage Arguments Details Value Note Examples
View source: R/fars_functions.R
This function takes years and a state number and plots the accident locations within that state.
1 | fars_map_state(state.num, year)
|
state.num |
A state number from the alphabetical list of states. |
year |
The year from which you want to draw data. |
The function uses make_filename
and fars_read_years
to
pull data from the Fatality Analysis Reporting Spreadsheet for the given years.
It then checks to ensure the chosen state number is valid and that there
were fatal accidents in that state for the given year. If there were, it
uses the maps and graphics packages to plot the locations of those accidents
along with a rough outline of the state's boundaries.
This function, even when successfully run, returns NULL invisibly. However, it generates a plot in the course of running.
These examples plot the accidents from Alabama in 2014 and Arkansas in 2013, respectively.
1 2 | fars_map_state(1,2014)
fars_map_state(4,2013)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.