This repository is connected with the final assignment for Building R Packages module of the Mastering Software Development in R specialization (coursera). The goal is to apply the basic concepts learnt in the module for creating, writing, documenting, and testing an R package.
The development of the package is done introducing the following software engineering practices:
roxygen2
knitr
and R Markdowntestthat
IMPORTANT!! The "maps" package has been added in the Depends section in the DESCRIPTION file because it sets some environment variables when its loaded & attached, which doesn't happen if () is used throwing a "stateMapEnv not found" error.
farsr
package The goal of fars
is to help you performing basic operation on Fatality Analysis Reporting System (FARS) data, a nationwide census providing the American public yearly data regarding fatal injuries suffered in motor vehicle traffic crashes. Specifically it allows you to perform the following operations:
#Using devtools and Github
devtools::install_github("pparacch/fars")
#load and attach the package
library(farsr)
Use the following table to have an overview of the provided functions:
Functionfars_read()
Read a FARS datafile
fars_read_years()
Read FARS datafile(s) for provided year(s)
fars_summarize_years()
Summarizes injuries by month for provided year(s)
fars_map_state()
Visualize map with injuries for provided state (USA) and year
More info can be found in the package vignette vignette('introduction', package = 'farsr')
and help of provided function e.g. ?farsr::fars_read_years
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.