Description Usage Arguments Value Note Examples
View source: R/fars_functions.R
fars_map_state
maps out the fatal motor vehicle accidents
for a particular state in a particular year, according to data
compiled by the Fatality Analysis Reporting System (FARS) of
the US National Highway Traffic Safety Administration.
1 | fars_map_state(state.num, year, dir = "./inst/extdata")
|
state.num |
number of state for which data is requested (between 1 and 51). |
year |
desired calendar year |
dir |
a character string containing the directory that contains the FARS data |
The function plots a map of the state in question, with points marking the locations of fatal motor vehicle accidents in the specified year.
An error message will be generated if the state number is not in the required range (1 to 51), if the data file for the specified year cannot be found, or if the data file is not in the proper FARS format.
1 2 3 | dir <- system.file("extdata",package="msdr3pam")
fars_map_state(26,2013,dir=dir)
fars_map_state(1,2015,dir=dir)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.