Skip to contents

Initialize a new scdrake project.

Usage

init_project(
  dir = ".",
  use_rstudio = TRUE,
  set_active_project = TRUE,
  set_wd = TRUE,
  download_example_data = FALSE,
  ask = TRUE,
  verbose = getOption("scdrake_verbose"),
  ...
)

Arguments

dir

A character scalar: path to directory in which the project will be created. If NULL, the current working directory will be used (same as the default: "."). Subdirectories will be created recursively.

use_rstudio

A logical scalar: if TRUE, initiate an RStudio project inside dir.

set_active_project

A logical scalar: if TRUE, set active project to dir.

set_wd

A logical scalar: if TRUE, change the current working directory to dir.

download_example_data

A logical scalar: if TRUE, download example PBMC 1k and 3k data to {dir}/example_data. See download_pbmc1k() and download_pbmc3k() for more details on these datasets.

ask

A logical scalar: if TRUE, do not prompt and overwrite an existing project.

verbose

A logical scalar: if TRUE, be verbose. The default value is obtained from getOption("scdrake_verbose").

...

Passed to download_yq().

Details

This function will:

  • Create the project's root directory.

  • (Optional) Switch the current working directory to the project's root and call here::i_am().

  • Copy config, RMarkdown, and _drake_*.R files.

  • Create an empty .here file. This ensures that the here package will be able to find the project's root directory in case an RStudio project is not initialized.

  • Check whether the yq tool is available in PATH environment variable.

  • (Optional) Download the example data using download_pbmc1k() and download_pbmc3k().

  • (Optional) Initialize an RStudio project and set it as the active project.

Examples

if (FALSE) {
init_project("my_project")
}