Description Usage Arguments Value Examples
This function takes in a state number ("state.num") and year ("year") as arguments. It reads the corresponding accident data file per the "year" argument, extract data corresponding to the specified state, then uses the map function from maps package to provide a map plot showing the locations corresponding to the accident data for the specified state in the specified year. The function will stop if the state number entered is invalid, and will also not provide any plot if there are no accidents for the specified state in the given year.
1 | fars_map_state(state.num, year)
|
state.num |
Integer (1 to 56) corresponding to the state of interest. |
year |
Integer (e.g. 2013) denoting the year for which the map plot is desired. |
This function returns a map plot showing the location of accidents for the specified state in the specified year.
1 | fars_map_state (20, 2013)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.