This function generates a scatter plot map where x and y axes are defined by
longitude and latitude of a state (according to
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".
A string that can be used to find the state of interest in the data frame.
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.
## 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.