fars_map_state: Map Accidents

Description Usage Arguments Details Value Examples

Description

This function maps accidents in individual U.S. State in a given year

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

the unique identification of a U.S. state

year

relevant data year

Details

For a given year value, this function read the relevant data file using the make_filename and fars_read functions. It checks that the stae exists and that any accidents were reported that year in that state. The function also removes erroneous longotude and lattitudes entries in the raw data (longitude>900 and lattitude>90) and uses the map package to draw the relevant map and the graphics package to plot dots.

Value

a long/lat plot of reported accidents in the U.S. state and year of choice against a state boundary map

Examples

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

## End(Not run)

barnabe/building_an_r_package documentation built on May 11, 2019, 6:23 p.m.