fars_map_state: Draw a map of accidents by State and Year

Description Usage Arguments Details Value Examples

Description

Draw the location of each accident in a given State in a given year.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

A number corresponding to a State in the FARS data.

year

A character or number representing a single target year.

Details

Loads the file with the name "accidnet_year.csv.bz2" where year corresponds to the value of year. Can only read and map one year at a time. Calls map::maps and graphics::points to plot the accidnets by latitude and longtude. Will produce an error if the state.num is incorrect or the file for the given year does not exist.

Value

A plot of the accident locations in the State in the target year

Examples

1
2
3
4
5
## Not run: 
fars_map_state(17, 2016)
fars_map_state(21, "2016")

## End(Not run)

burch-cm/farsdata documentation built on May 13, 2019, 8:46 a.m.