fars_map_state: Plots all accidents in a given state during a given year in a...

Description Usage Arguments Details Examples

Description

This function takes the number of a state and the number of a year and plots all accidents from the FARS data set which happened during the given year in the given state. Each accident is represented by a point on a map of the given state.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

the index number of a state

year

the number of a year

Details

This function returns NULL, but as a side effect the state map as described above is plotted.

This function throws an error if the given state number does not occur in the FARS data set.

Errors may also be thrown by calls to the plotting functions, such as maps::map("state"). This happens, for example when calling fars_map_state(2, 2013).

One reason for errors could be missing data in the requested data set. This function implicitly sets missing longitudes to 900 and missing latitudes to 90. These values may be outside the bounds of the state map and therefore cause plotting to throw errors.

Examples

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

## End(Not run)

plexxx/myAssignment documentation built on May 9, 2019, 12:49 p.m.