Description Usage Arguments Details Value Examples
This function will read the file according to the year you give and according to the state number you give. It will plot accidents for the year and the state.
1 | fars_map_state(state.num, year)
|
state.num |
- the number of the state you want to inspect and plot. year - numeric. from which year you want to plot your data? |
year |
- numerical variable |
this function uses 'filter' function from dplyr, 'map' function from maps and 'points' function from graphics package. All LATITUDEs > 90 and LONGITUDEs >900 will not be plotted. If your there is no data for the given state in the given year, an error message will be printed. If there is no state with given state.num, the function will stop with an error printed.
the function will return a world map but with limited longitudes and latitutes shown (only the ones including state regarding the state.num argument). Each dot on the map will represent a accident which happend in the corresponding year and corresponding state in the USA.
1 2 3 4 5 | ## Not run:
fars_map_state(4, 2013)
fars_map_state(6, 2013)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.