Description Usage Arguments Value References See Also Examples
This function creates a map that has a point in each accident location. fars data files must be in working directory.
1 | fars_map_state(state.num, year)
|
state.num |
single integer state code in the USA. Function will throw an error in case no data is available for selected state and year. In case you input a vector only first element, if data exists, will be plotted and function will throw a warning. |
year |
single integer value of the year that will be plotted |
a map object of the selected us state with points in the accident location of selected year.
http://www.nhtsa.gov/Data/Fatality-Analysis-Reporting-System-(FARS)
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# plot existing region
fars_map_state(1, 2013)
# function throws error as data is not available
fars_map_state(2, 2013)
# map is plotted but function throws warning
fars_map_state(c(1,3), 2013)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.