fars_map_state: Plots the map of the USA and the places with accidents...

Description Usage Arguments Details Value Examples

Description

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.

Usage

1
fars_map_state(state.num, year)

Arguments

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

Details

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.

Value

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.

Examples

1
2
3
4
5
## Not run: 
fars_map_state(4, 2013)
fars_map_state(6, 2013)

## End(Not run)

dkurtoic/fars documentation built on May 7, 2019, 10:38 a.m.