/R_Package_Validation_Tutorial

Bookdown Tutorial for R Package Validation Framework

Primary LanguageR

R Package Validation Tutorial

Overview

Welcome to the R Package Validation Tutorial!

Based on the R Package Validation Framework White Paper that is in pubic review under PHUSE, this tutorial aims to teach the basics of R package development while creating all the necessary documentation to support a validation. The training will show how to use the {valtools} package as part of the development process.

By the end of this tutorial, you will know how to apply the R Package Validation Framework to your internal R packages, and apply the {valtools} package.

🗓️ PHUSE CSS Conf, Monday September 13th
👨‍💻 @thebioengineer
👩‍💻 @mariev

Schedule & Materials

Slides and exercises are grouped by section. Exercises are split into Spartan or Verbose, indicating the amount of supplementary information provided. An answer key is also provided in the folder.

Time Section Slides Exercises
0 - 10 Welcome and Orientation Welcome Slides
10 - 30 Concepts of R Package Validation Introduction to the R Package Validation Framework
40 - 50 Introduction to {valtools} Intro to {valtools}
50 - 90 Using {valtools} Elements of Validation 04: Writing test code
90 - 125 Validation Reports  The Validation Report 05: Creating a validation report
125 - 135 Break/Q&A
140 - 180 Types of Validation & Q&A Modes of Validation 06: Validation in a new environment

Setup

  1. RStudio cloud instructions
  2. [Optional] setup for running code locally:
# you will need to install the following packages from CRAN
install.packages(c("devtools", "roxygen2", "testthat", "usethis", "knitr"))

# you will need to install the following packages from github
remotes::install_github("phuse-org/valtools", build_vignettes = TRUE)

Why take the the R Package Validation Tutorial?

This tutorial addresses a major knowledge gap in the R ecosystem: getting R accepted into highly regulated industries. This is an opportunity for those that work in these industries to be empowered to expand the use of R. We are taking an approach where some basic R knowledge is expected, such as writing scripts and functions, but teaching people to take the next steps.

Previous work presented to the community has shown a framework for developers to distribute validation-ready R packages, which has been met with enthusiasm among R users in pharma. In this tutorial participants will experience the process of creating R packages with validation resources in place and explore how addition of these materials perform in a variety of real-world scenarios, including validation-on-install and validation-post-install. Participants will have the opportunity to practice how validation affects subsequent package releases.

References

Acknowledgments

This workshop was developed by employees of Fred Hutch Cancer Research Center - SCHARP - VISC. We also recieved support from R/Pharma in the form of RStudio Cloud access to facilitate training.