fars_map_state: Maps FARS crash locations by state and year

Description Usage Arguments Details Examples

Description

Plots a map showing FARS crash locations for a specified state and year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

Integer state code. See https://crashstats.nhtsa.dot.gov/Api/Public/Publication/812315 (PDF), p. 26 for a list.

year

Integer year.

Details

The maps package must be loaded so that the the stateMapEnv object is available. (The maps package does not export stateMapEnv.) Do this by running library(maps) .

Crashes with LOGITUD > 900 or LATITUDE > 90 are excluded.

Invalid state or year values will produce errors.

Examples

1
2
library(maps)
fars_map_state(19, 2015) # 19 is Iowa

davidbody/FARSAssignment documentation built on May 14, 2019, 10:37 p.m.