R/nonmem_report.R

Defines functions nonmem_report

Documented in nonmem_report

#' create basic folder structure for a nonmem report
#' @name nonmem_report
#' @param project name of top level project folder
#' @param secondary_folders list of subfolders
#' @details
#' A placeholder.txt file is created in each subfolder to allow for
#' initial folder structure to be maintained if using a version control
#' system such as git (as empty directories are not kept)
#' 
#' Currently only works if there is no project folder with the same name, and
#' does not do any checking (will just error out)
#' @examples
#' \dontrun{
#' nonmem_report("Drug-x")
#' nonmem_report("Drug-x", list("Rscripts", "nonmem","CTS", "data"))
#' }
#' @export 
nonmem_report <- function(project = NULL,
         secondary_folders = list("scripts", 
                                  "modeling", 
                                  "lab-notebook", 
                                  "data",
                                  "reports")) 
{
if (!is.null(project)) {
  dir.create(project)
  lapply(secondary_folders, function(x) {dir.create(paste0(project ,'/', x))
                                         file.create(paste0(project ,'/', x,"/", ".placeholder"))})
         } else {
         lapply(secondary_folders, function(x) {dir.create(paste0(x))
                                         file.create(paste0(x,"/", ".placeholder"))})    
         }
}

Try the PKPDmisc package in your browser

Any scripts or data that you put into this service are public.

PKPDmisc documentation built on April 14, 2020, 5:49 p.m.