esubdemo is a demo project to illustrate how to organize analysis scripts in an R package folder structure.
The demo project follows the concepts discussed in:
By using an R package folder structure and the associated development tools, we are able to achieve:
Below are the minimal sufficient folders and files leveraging the R package folder structure.
*.Rproj: RStudio project file for opening the project.DESCRIPTION: Metadata for a package including authors, license, dependencies, etc.vignettes/: Analysis scripts using R Markdown.R/: Project-specific R functions.man/: Manual of project-specific R functions.There are additional folders and files required in this demo for an analysis project.
People may use different folder names as it is not a standard R package folder. These folders and files often need to be added in
.Rbuildignoreto pass automated checking.
vignettes/data-adam/: ADaM datasets in .sas7bdat format.
inst/extdata/ following R package convention
vignettes/tlf/: TLF outputsrenv.lock and renv/: R package management using the renv package (introduction)._pkgdown.yml: pkgdown configuration file.Rprofile: Project startup file to setup running environment including R version, package repository, folder paths, etc.
inst/startup.R and R/zzz.R to ensure the startup file is executed both when running devtools::load_all() and running regular build & reload.