fars_map_state: Plot accidents location.

Description Usage Arguments Value References See Also Examples

Description

This function creates a map that has a point in each accident location. fars data files must be in working directory.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

single integer state code in the USA. Function will throw an error in case no data is available for selected state and year. In case you input a vector only first element, if data exists, will be plotted and function will throw a warning.

year

single integer value of the year that will be plotted

Value

a map object of the selected us state with points in the accident location of selected year.

References

http://www.nhtsa.gov/Data/Fatality-Analysis-Reporting-System-(FARS)

See Also

map

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# plot existing region
fars_map_state(1, 2013)

# function throws error as data is not available
fars_map_state(2, 2013)

# map is plotted but function throws warning
fars_map_state(c(1,3), 2013)

## End(Not run)

pabgamu/firstR documentation built on May 24, 2019, 5:57 p.m.