fars_map_state: This function generate a map of all FARS events in one or...

Description Usage Arguments Value Note Examples

Description

This function generate a map of all FARS events in one or more US states, with each event displayed as a dot on the map. User may specify the state(s) by unique ID# and year from which FARS event data should be drawn.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

An integer vector that uniquely identifies one or more US states in the FARS dataset

year

An integer representing the year that will be inserted into the file name

Value

Returns map plot of one or more US states with black dots representing FARS events in the selected year

Note

This function throws an error if an invalid year is selected (not a number or not a year in the available dataset(s))

It also throws an error if an invalid state.num is specified

More than one state may be selected at a time, generating a country-wide map with data plotted for selected states

If a valid subset of data is selected, but not FARS events are avaialble, the function will print a message indicating that

Examples

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

samthomasRLA/FARS documentation built on May 28, 2019, 5:40 p.m.