R/create.project.rstudio.R

Defines functions create_project_rstudio

create_project_rstudio <- function(path, template, dump, merge)
{

  .stopifproject(c("Cannot create a new project inside an existing one",
                   "Please change to another directory and re-run create.project()"),
                 path = normalizePath(dirname(path)))

  .stopifproject(c("Cannot create a new project inside an existing one",
                   "Please change to another directory and re-run create.project()"),
                 path = dirname(normalizePath(dirname(path))))

  dir.create(path, recursive = TRUE, showWarnings = FALSE)



  ProjectTemplate::create.project(
    project.name = path, template = template,
    dump = dump, merge.strategy = ifelse(merge, "allow.non.conflict", "require.empty"),
    rstudio.project = TRUE
  )
}

Try the ProjectTemplate package in your browser

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

ProjectTemplate documentation built on Nov. 20, 2023, 1:06 a.m.