A fragment of a package to parse, munge and display data of the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System (FARS) written for the Coursera course "Building R packages". The original website indicated in the course is no longer accessible, hence explantions for e.g. state IDs an

Data

Data is not included in the package and needs to be downloaded from the course site. Unfortunately, the website to explain the data is no longer available.

Simple examples

The useful functions of this package are fars_map_state and fars_summarize_years. Other functions merely provide basic funtionalities used by top-level functions.

Mapping accidents by state

fars_map_state will present an image of the location of accidents on a map of the state.

fars_map_state(48, 2014) 

Summary by month

A simple breakdown by month of the respective years.

fars_summarize_years(2013)

Internal functions

In principle, these functions provides only very basic routines. In a final package, they would probably not be exported and include more resilience, e.g. for missing installation data etc.

fars_file <- make_filename(2013)
fars_df <- fars_read(fars_file)
fars_simple_df <- fars_read_years(years)


rolandkrause/ffars documentation built on May 27, 2019, 1:47 p.m.