fars_map_state: Map FARS data by state

Description Usage Arguments Details Value Examples

View source: R/fars_functions.R

Description

Geographically plots highway fatalities from FARS data, subset by state.nm and year arguments.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

Number encoding of state in FARS data. Argument can be input as integer or string. More information including codebook can be found at NHTSA website https://www.nhtsa.gov/research-data.

year

Four-digit year as integer or string of the data to be plotted.

Details

If state.num not found in data, function stopped and "invalid STATE number" error will be returned. If no data file exists for year, call to fars_read will return "file does not exist" error.

If there are no fatalities for described subset, returns message "no accidents to plot"

If the given value for state.num is not a state in the dataset, a "invalid STATE" error is raised.

Value

NULL value

Examples

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

## End(Not run)

connermcb/FARSfunctions documentation built on May 18, 2019, 8:11 p.m.