fars_map_state: Overlay accidents locations onto map of given state in given...

Description Usage Arguments Value Note Source Examples

Description

The accident locations are plotted on the map of STATE given as input argument (integer). Function checks whether there is such STATE for given YEAR, and throws "invalid STATE number" if it is missing. If there are no accidents for given state, then "no accidents to plot" information is presented. Read single FARS file from working directory with given YEAR argument into tbl_df objects.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

the index number of a state as an integer corresponding to a required state. The function throws an error if no fatality information is available for the requested state in the FARS data for the requested year.

year

A Year provided as a string or an integer. If the year is absent from the FARS data, this throws an error.

Value

NULL return value. The function plots a graph as a side-effect If no accidents were observed in the state/year, no map is plotted.

Note

Source

Coursera, Building R Packages

Examples

1
2
3
## Not run:  fars_map_state(44,2013)
## Not run: fars_map_state(2,2015) # do not works for this year and 2013,2014 as well.
## Not run: #Returns: nothing to draw: all regions out of bounds

krzyklo/fars documentation built on May 19, 2019, 8:23 a.m.