library(courserafars) library(dplyr) library(maps)
This document introduces you to the basics of this package. This packages provides a set of functions to analyze accident data files created by the National Highway Traffic Safety Administration NHTSA. The files record fatal motor vehicle accidents in the United States.
One main function of this package is to summarize accident data by month, across years. This is done with the fars_summarize_years()
function, which takes a vector or list of years and outputs a comparison table. Note that the accident data files must be in the working director of the session.
setwd(system.file("extdata", package = "courserafars")) fars_summarize_years(c(2013,2014))
This package also allows you to visualize accidents in a given year in a given state. This is done through the fars_map_state()
function. For instance, in the following example, we plot all of the accidents in Florida for the year 2014.
setwd(system.file("extdata", package = "courserafars")) fars_map_state(12,2014)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.