Description Usage Arguments Value Examples
View source: R/fars_functions.R
This function generates a scatter plot map where x and y axes are defined by
longitude and latitude of a state (according to state.num
)
in a specific year
to reflect the location of accidents. If the state
cannot be found in the dataset, the function halts and throws an error message.
If there is no accidents in the state for the given year, the function returns
NULL with a message "no accidents to plot".
1 | fars_map_state(state.num, year)
|
state.num |
A string that can be used to find the state of interest in the data frame. |
year |
A string that can be used to find the file of the specific year. |
This function returns NULL if no accidents occurred in the state during the given year. Otherwise, it returns a scatter plot that highlights the locations defined by longitude and latitude of accidents occurred.
1 2 | ## Not run: fars_map_state("13", "2014")
## Not run: fars_map_state("0", "2013")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.