Intro to Fatality Analysis Reporting System (FARS)

The functions provided in the fars package facilitate working with data from the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System, which is a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes.

Installation

You can install the package from GitHub using the devtools package:

devtools::install_github("vadimus202/fars")

Usage Examples

Copy FARS files into working directory

The package includes sample csv files for 2013-2015 data.

library(fars)
library(magrittr)
library(knitr)

my_file <- system.file("extdata", "fars_data.zip", package = "fars")
unzip(my_file, junkpaths = TRUE)

Preview 2015 FARS data

file_name <- make_filename(2015)
df <- fars_read(file_name)
df %>% head() %>% kable()

Summarize 2013-2015 data

fars_summarize_years(2013:2015) %>% kable()

Plot 2014 accidents on California state map

fars_map_state(6,2014)


vadimus202/fars documentation built on May 3, 2019, 2:41 p.m.