R/copy_drakeospsreports_files.R

Defines functions copy_drakeospsreports_files

Documented in copy_drakeospsreports_files

#' @title Save the Source Code Files of the \code{ospsreports} Workflow
#' @description Copy the files of a packaged \code{drake} workflow into a supplied directory.
#' @param to Character scalar, file path, where to write the folders containing the workflow's files.
#' @param overwrite_dirs Logical vector (named), A vector of logical values with names that exactly match the \code{directories} values
#' @param package Character scalar, the name of the source package
#' @return `NULL`
#' @importFrom purrr map
#' @importFrom purrr walk2
#' @examples
#'
#' \dontrun{
#'
#' copy_pkg_files(
#'                overwrite_dirs = c("intdata" = TRUE,"documents"=TRUE),
#'                package = "drakepkg")
#'
#' }
#'
#' @export
copy_drakeospsreports_files <- function(to = getwd(),
                           overwrite_dirs = c("intdata" = TRUE, "documents" = TRUE),
                           package = "ospsreports"){

  directories = c("intdata","documents")
  
  copy_ospsreports_files(to = to,
                 directories = directories,
                 overwrite_dirs = overwrite_dirs,
                 package = package)
  
  move_ospsreports_files(to=to)

}
JGWojtyniak/ospsreports documentation built on Nov. 14, 2019, 12:11 p.m.