The fars
package is an example created for a course assignment.
FARS is the US National Highway Traffic Safety Administration's Fatality Analysis Reporting System.
The functions and sample raw data in this package read, summarize and plot accident sites by US state and year/month.
The sample data in the inst/extdata directory covers the years 2013 to 2015. It is as provided in the week 2 assignment (one file per year, in csv.bz2 format). As we only use a small number of variables, I document them in the vignette rather than create a specific help file.
I made two changes to the functions:
make_filename
to allow tests to access the sample data. A new parameter internal
has been added to several functions, which defaults to TRUE
(meaning: use sample data, not external data). The package vignette and function help have further details.
This package is solely on GitHub and intended for peer reviewers taking the same course, or other valid educational purpose. I hope you learn something from me and thanks for any feedback.
You can install fars from the R console as follows:
devtools::install_github("rwpalin/fars", build_vignettes=TRUE)
Below is a simple example that: Summarizes the sample data Plots state 48 (Texas) for the year 2015
library(fars)
fars_summarize_years(2013:2015)
fars_map_state(48,2015)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.