Description Usage Arguments Value Note Examples
View source: R/fars_functions.R
This function takes as input a numeric value for a state as well as specific year. If the data set exists and the chosen state is present in the data, the longitude and latitude for these two parameters are extracted to plot the locations on a map of the state. #'
1 | fars_map_state(state.num, year)
|
state.num |
A numeric value from 1 to 56 for a US state |
year |
A year for which you expect that FARS data is available. |
This function plots the locations of each data point of the FARS data on a state map.
The function brings up a warning in case the data does not exist for the year provided to the function and the function stops if the state number given as an argument does not exists. In case no data is available for a given state number and year, a message will inform the use that the are no accidents available to be plotted.
1 2 3 4 | ## Not run:
fars_map_state(5,2015)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.