knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Tools for Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS)

Setting up FARS

library(fars)

About data

The FARS data files are expected to be in the working directory and their names should be accident_YYYY.csv.bz2. Missing files cause an error. The specific FARS data format is as provided by Coursera course Building R Packages by Johns Hopkins Univ.

Map

You can draw a wireframe map of a given state and year from US National Highway Traffic Safety Administration's Fatality Analysis Reporting Syste (FARS) data for given years.

fars_map_state(1, 2013)

Fatal accident map

Other functions

You can Cross-tabulate number of fatal highway accidents by month and year (FARS data) by fars_summarize_years.

fars_read_years is for loading the data into a data frame



jhimberg/r_packages_excercise documentation built on April 9, 2020, 11:10 p.m.