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 insidedir
.- set_active_project
A logical scalar: if
TRUE
, set active project todir
.- set_wd
A logical scalar: if
TRUE
, change the current working directory todir
.- download_example_data
A logical scalar: if
TRUE
, download example PBMC 1k and 3k data to{dir}/example_data
. Seedownload_pbmc1k()
anddownload_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 fromgetOption("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 inPATH
environment variable.(Optional) Download the example data using
download_pbmc1k()
anddownload_pbmc3k()
.(Optional) Initialize an RStudio project and set it as the active project.