knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

fars

Build Status

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.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Halberdier/fars")

Exported functions

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.

Summarizing years

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))

Plotting accidents on a state map

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)


Halberdier/fars documentation built on March 22, 2020, 12:58 a.m.