[Cheat Sheet] Building the package - openpharma/visR GitHub Wiki
We are using devtools, usethis and pkgdown to build the package and create (hopefully meaningful) documentation.
If you are not familiar with the R packages, at least the following commands will be useful for contributing code, building and checking the package
Creating a new function
# Create empty R file to define function
usethis::use_r()
# Matching R testthis file where your unit tests should live
usethis::use_test()
Updating roxygen documentation (incl. namespace) and building
devtools::document()
followed by devtools::build()
Install the package locally:
Simulate installing without actually installing the current version of the package
devtools::load_all()
Actually install the package
devtools::install()
Load installed version package
library(visR)
Build the page incl. documentation:
pkgdown::build_site()
After making changes and before committing, check the build using R CMD check:
devtools::check()
If you want to see how your brand new tests upped the code coverage
covr::report()
More can be found in Hadley's book on R packages: https://r-pkgs.org/
About the packages that we use to help with our development workflow: