knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of fars is to facilitate visualization of data from the FARS, the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("Halberdier/fars")
library(fars)
This package exports two convenient functions for visualization of data from the FARS, the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System.
The first function is fars_summarize_years
, which gets a vector of years as argument and provides a tibble with one column per given year with the number of accidents per month, as in the following example:
fars_summarize_years(c(2013, 2014))
The second function is fars_map_state
. Given a US state numeric code and a year, it plots the accident locations on the state map. The states are encoded according with the Federal Information Processing Standard (FIPS).
In the following example, Florida is shown (code 12), easily recognizable.
fars_map_state(12, 2014)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.