The farspractise package allows you to analyze data about fatal accidents by using the Fatality Analysis Reporting Sysetm from the US National Highway Traffic Safety Administration.

Functions

The package contains 5 functions from which fars_summarize_years() prepares a report of the fatal accidents in the desired years while fars_map_state() plots the observations of the given years in the provided state. The remaining functions (fars_read(), make_filename(), fars_read_years()) are called by these two functions and are also available for the user. The working directory should contain the observational data.

Example data

The package provides data from the observations of years 2013, 2014, 2015 for practicing purposes.

Examples

You can plot fatal accident data in Pennsylvania in 2013 by calling:

library(farspractise)
setwd(system.file("extdata",package = "farspractise"))
fars_map_state(39,2013)

Alternatively, you can get summarized data from observations in years 2013 - 2015 in all states of the USA by calling

fars_summarize_years(2013:2015)

Session info:

sessionInfo()


ortzsu/farspractise documentation built on May 24, 2019, 3:58 p.m.