fars_map_state: Plot the location of accidents in a given state and year

Description Usage Arguments Details Value Note Examples

Description

fars_map_state is a function that creates a map with the fatalities in a US State during a year according to the Fatality Analysis Reporting System (FARS) database.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

An integer that represents the state number.

year

An integer or string indicating the year.

Details

This function takes the state number and a year as inputs and calls the supporting functions make_filename() and fars_read().

Value

Plots a map of the state, where the fatalities are the dots on the map.

Note

The state.num parameter of this function must be an integer or a string with number. This function stops execution with an error message if state.num is invalid. If there hasn't been any accident in that year, this function produces a message.

Examples

1
2
3
4
5
6
## Not run: 
fars_map_state(30, 2013)
fars_map_state(56, 2013)
fars_map_state(70, 2014) ## Error: "invalid STATE number: 70"

## End(Not run)

lahstorti/FARS.functions documentation built on May 15, 2019, 3:32 p.m.