fars_map_state: Plot Location of Motor Vehicles Traffic Crashes

Description Usage Arguments Details Value Examples

Description

The function plots a map that shows where in the specified state the accidents occurred during the specified year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

State number

year

Year of interest

Details

Internally, the function uses make_filename and fars_read functions to load the data, filters by state and plots accidents using the map function of the maps package. Only one state and one year can be specified in the function call. If the user enters wrong state number, the function will abort, throwing out an error. If the user filters out all of the data, the function will print an appropriate message.

Value

The function plots a map of the state with points representing locations at which the accidents occurred.

Examples

1
2
3
4
## Not run: 
fars_map_state(10, 2014)

## End(Not run)

bzunar/trafficSafety documentation built on June 5, 2019, 7:57 a.m.