fars_map_state: Maps points on the state map where accidents occured

Description Usage Arguments Details Value Examples

View source: R/fars_function.R

Description

fars_map_state function takes state number and year to map points on the state map where accidents occured.

Usage

1
fars_map_state(state.num, year)

Arguments

state.num

An integer representing a state as the index (between 1 and 56).

An

integer representing the year.

Details

fars_map_state function assumes that there will be a single integer value for state.num and single integer value for year. The implementation do not specifically check for these constraints.

If state does not exist in queried year: a error message of "nothing to draw: all regions out of bounds" apprears.

If multiple states will be entered as a vector: a warning message will appear stating "only the first element will be used", on the other hand, the graph will be created properly including all states inputted.

If an empty vector of states is inputted: an error message of "argument is of length zero" wil be displayed

If a non-existing year is entered: an error message of "Error in fars_read(filename) :" will be displayed.

If multiple years will be entered as a vector: an error message of "EXPR must be a length 1 vector" will be displayed.

If an empty vector of years is inputted: an error message of "argument is of length zero" wil be displayed

Value

This function returns a NULL object. But as a side effect a map where dots represent accidents also appears in a seperate window.

Examples

1
2
3
4
## Not run: 
fars_map_state(state.num = 1, year = 2013)

## End(Not run)

Nilesh1978/fedtrafat documentation built on May 21, 2019, 7:53 a.m.