R/create_project.R

Defines functions create_project create_bin

create_project <- function(path,...) {

  dir.create(path, recursive = TRUE, showWarnings = FALSE)
  dots <- list(...)

  lapply(c("data","src","notebooks","reports","bin"), function(dir) {
    dir.create(paste0(path,"/",dir))
  })
  # create
  create_bin(path)

  lapply(c("remake.yml","config.yml","credentials.yml"), function(dir) {
    file.create(paste0(path,"/",dir))
  })

  arg_file <- paste0(path,"/","arguments.yml")
  yaml::write_yaml(dots,arg_file)
}

create_bin <- function(path) {
  # Create bin directory with scripts that will be called from outside the projects
  file.copy(
    from = system.file(
      "common/bin",
      package = "agileds"),
    to = path,
    recursive = TRUE)
}
sgp667/agileds documentation built on May 20, 2019, 8:33 a.m.