Description Usage Arguments Details Value Examples
This function takes a state number and year as its argumants, and returns a
map of all all accidents in that state and year. The function requres FARS
raw datsets saved in getwd()
.
1 | fars_map_state(state.num, year)
|
state.num |
an integer, or an object that can be coerced into integer, representing a state number |
year |
an integer, or an object that can be coerced into integer, representing a calendar year |
An invalid state number throws an error. If no accides found in that state,
the function returns NULL
silently. The function uses imported
maps::map()
to plot the data.
a plot of a state accidents on a map
1 2 3 4 | # unzip files into your \code{getwd()}
my_file <- system.file("extdata", "fars_data.zip", package = "fars")
unzip(my_file, junkpaths = TRUE)
fars_map_state(16, 2015)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.