Description Usage Arguments Details Value Examples
View source: R/fars_function.R
fars_map_state
function takes state number and year to map points on the state map where accidents occured.
1 | fars_map_state(state.num, year)
|
state.num |
An integer representing a state as the index (between 1 and 56). |
An |
integer representing the year. |
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
This function returns a NULL object. But as a side effect a map where dots represent accidents also appears in a seperate window.
1 2 3 4 | ## Not run:
fars_map_state(state.num = 1, year = 2013)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.