fars_map_state: Plot a map of accidents in a given state for a given year

Description Usage Arguments Value Note Examples

Description

This is a function that takes a state number and a year and plots accidents on the states's map

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

a state in numeric format

year

a year in numeric format or a list of such years

Value

this function returns a map on the graphical device, a message "no accidents to plot", or a message saying that the provided state number is invalid.

Note

requires the package maps to be loaded, otherwise produces an error. For some states, the function fails with the message "nothing to draw: all regions out of bounds", e.g. for state.num = 2.

Examples

1
2
3
## Not run: 
fars_map_state(6, 2015) 
## End(Not run)

yuriygdv/farsfunctions documentation built on May 22, 2019, 2:47 p.m.