Skip to contents

Generate a project template directory.

Usage

template(
  project_name,
  path = ".",
  type = projectTypes(),
  renv = TRUE,
  docker = TRUE,
  git = TRUE,
  github = FALSE,
  private = FALSE,
  github_actions = FALSE,
  force = FALSE,
  start = TRUE
)

Arguments

project_name

project name/title

path

target file path for project directory

type

project type. Should be one returned by projectTypes().

renv

add renv infrastructure for reproducible a R package environment

docker

TRUE/FALSE. Create project infrastructure for building a docker container to compile the project.

git

TRUE/FALSE. Initialise a Git repository?

github

TRUE/FALSE. Create a GitHub repository? Ignored if argument git is FALSE.

private

TRUE/FALSE. Should the GitHub repository be private? Evaluated only if arguments git and github are TRUE.

github_actions

TRUE/FALSE. Add Github actions infrastructure? Evaluated only if arguments git, github and docker are TRUE.

force

force project creation if project directory already exists

start

TRUE/FALSE. Should the project be automatically activated in a new RStudio session?

Examples

if (FALSE) {
template('A new project',
         type = 'report',
         github = FALSE,
         start = FALSE)
}