Description Usage Arguments Details Value Note Examples
fars_map_state
is a function that creates a map with the fatalities in a US State
during a year according to the Fatality Analysis Reporting System (FARS) database.
1 | fars_map_state(state.num, year)
|
state.num |
An integer that represents the state number. |
year |
An integer or string indicating the year. |
This function takes the state number and a year as inputs and calls the supporting
functions make_filename()
and fars_read()
.
Plots a map of the state, where the fatalities are the dots on the map.
The state.num
parameter of this function must be an integer or a string with
number. This function stops execution with an error message if state.num
is
invalid. If there hasn't been any accident in that year, this function produces a message.
1 2 3 4 5 6 | ## Not run:
fars_map_state(30, 2013)
fars_map_state(56, 2013)
fars_map_state(70, 2014) ## Error: "invalid STATE number: 70"
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.