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 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.
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.
fars_map_state
will present an image of the location of accidents on a map of the state.
fars_map_state(48, 2014)
A simple breakdown by month of the respective years.
fars_summarize_years(2013)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.