fars package can pickup some data and plot graphic whit you input arguments from FARS data.FARS is a database which had build by National Highway Traffic Safety Administration.
FARS is a nationwide census, providing the American public yearly data, regarding fatal injuries suffered in motor vehicle traffic crashes.
library(fars) library(maps)
Data files included within the package:
list.files(system.file("extdata", package = "fars"))
make_filenameThis function make .csv file names related to the argument year.
yr <- 2013 make_filename(yr)
fars_read_yearsThis function takes a vector of years and produces a list of tibbles,where each tibble is that year's FARS file year and MONTH observations.
yr <- 2015 fars_read_years(yr)
fars_summarize_yearsThis function summarizes yearly accidents data, by month.
#plot(fars_summarize_years(2015)) #fars_summarize_years(c(2015, 2014))
fars_map_stateThis function provide a plot with a state map including the accidents location by year.
fars_map_state(35, 2013)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.