The msdr3pam package also includes a way to map where traffic fatalities occurred for a particular state in a given year.
As described in the Read and Summarize Data vignette, you must first obtain the data from the FARS archive and specify the path to the data. In this vignette, we will stick to the sample data included with the package, which contains FARS data for the years 2013, 2014, and 2015.
dir <- system.file("extdata",package="msdr3pam")
Once the path to the data is defined, you can use the function fars_map_states() to map where the fatalities occurred in a given year:
library(msdr3pam) fars_map_state(26,2013,dir=dir)
To see which numbers (1 to 51) correspond to which states, consult the FARS User Manual
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.