valtools helps automate the validation of R packages used in clinical research and drug development: It provides useful templates and helper functions for tasks that arise during project set up and development of the validation framework.
This package is created by the R Package Validation Framework PHUSE Working Group.
For background on the R Package Validation Framework
, watch this presentation from RStudio::Global Pharma X Session.
{valtools} is under active development. To get the latest version, install from github:
devtools::install_github("phuse-org/valtools")
{valtools} is intended to be a bolt-on addition to the standard package development process followed by usethis and devtools. All {valtools} functions start with vt
followed by a verb/descriptor to make them easy to follow.
The most common usage for valtools is to add elements required for validation under the R Package Validation Framework and facilitating validation. See the Starting New Validation Package using {valtools}
vignette for more details.
vt_use_validation()
adds the validation infrastructure to an existing R package.vt_use_req()
,vt_use_test_case()
,vt_use_test_code
add the requirements, test cases and test code to the validation folder.vt_use_change_log()
creates a change log in the validation foldervt_use_report()
creates the validation report Rmd that gets rendered into the validation report.
These functions are helper functions for use within the validation report Rmd.
-
vt_path()
allows user to base path from the validation directory. Similar idea to the {here} package, but for validation. -
vt_file()
allows the user to point to specific files and render them as child documents within the report. -
vt_scrape_*
family of functions allows users to scrape information from the validation infrastructure and returns a data.frame.vt_scrape_sig_table()
Scrapes the usernames and roles from the validation config filevt_scrape_val_env()
Scrapes the environment to give a snapshot of what packages and versions are loaded during validationvt_scrape_change_log()
Scrapes the change logvt_scrape_coverage_matrix()
Scrapes the coverage roxygen tags in the test casevt_scrape_function_editors()
Scrapes the editors of all the functionsvt_scrape_requirement_editors()
Scrapes the requirement editorsvt_scrape_test_case_editors()
Scrapes the test case editorsvt_scrape_test_code_editors()
Scrapes the test code editorsvt_scrape_risk_assessment()
Scrapes the risk assessments
-
vt_kable_*
family functions provides an opinionated formatting to thevt_scrape_*
functions to help quickly construct the report. -
vt_get_child_files()
returns the list of files that are indicated in the validation.yml to be included in the validation report. This allows for batch creation of the dynamic content in the report.
vt_validate_source()
installs the package temporarily and executes the validation report rmd to validate the source code on the current system.vt_validate_build()
installs the package temporarily, executes the validation report rmd, and compiles it into a bundle for installing.vt_validate_install()
installs the package temporarily, executes the validation report rmd, and installs the library to the machine.vt_validate_installed_package()
runs the validation report rmd for a package that was installed usingvt_validate_install()
for when the environment has changed.
Read the Starting New Validation Package using {valtools}
vignette for a high level overview of the functions that exist in {valtools} and their intended uses.
Cheat sheet on how to use the {valtools} R Package
Please note that the {valtools} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.