There are two things you can do with the fars package:
fars_summarize_years()
functionfars_map_state()
functionfars_summarize_years()
To summarize car accident fatalities by year, using the fars_summarize_years()
function, supply a year or vector of years between 2013-2015:
library(fars) fars_summarize_years(c(2013, 2014, 2015))
fars_map_state()
To visualize car accident fatalities within a state & year using the fars_map_state()
function, supply a single state code and single year between 2013-2015:
fars_map_state(48, 2015)
FARS state codes can be downloaded here.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.