Description Usage Arguments Details Depends on Examples
View source: R/fars_functions.R
Plots on a USA State map the fatal injuries suffered in motor vehicle traffic crashes for the requested year and state.
1 | fars_map_state(state.num, year)
|
state.num |
The State identifier as an |
year |
A vector containing the years of interests as |
This function performs the steps below:
Build the FARS file name from year
(using make_filename
).
Read the FARS data file in R as a data frame tables (using fars_read
).
Plot on a USA State map all the incidents related to the selected State (state
).
If the provided state
is not valid then execution is stopped and an
error is returned.
If the provided state
is valid and does not have any incidents then
execution is stopped and a message is returned.
filter
in the dplyr
package.
map
in the maps
package.
points
in the graphics
package.
1 2 3 4 5 | ## Not run:
fars_map_state(4, 2013)
fars_map_state("4", "2013")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.