This is an example vignette for the course "Mastering Software Development in R".

Data Used in Package

The functions in this package use 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. Data was provided in the form of files for each accident year (e.g., "accident_2013.csv.bz"). Source data is at https://www.nhtsa.gov/research-data/fatality-analysis-reporting-system-fars

Functions

These functions are mainly for internal use by the package:

These functions produce output summarizing the FARS data:

Example for fars_summarize_years

This shows how the package can be used produce a table accidents by month for 2014 and 2015

library("MyPackage")
library("magrittr")
library("tidyverse")
fars_summarize_years(2014:2015)

Example for fars_map_state

This shows how the package can be used to compare the location of accidents in West Virginia from 2013 to 2015

library("maps")
library("MyPackage")
fars_map_state(21,2013)
fars_map_state(21,2014)
fars_map_state(21,2015)


zjosha/MyPackage documentation built on May 23, 2019, 4:04 p.m.