| create_proj | R Documentation |
Create all the scaffolding for a new project in a new directory. The
scaffolding includes a README file, different folders to hold raw data,
analyses, etc, a _targets.R pipeline template,
renv dependency management,
and a CITATION.cff file. Optionally, initialize a git repository
and/or set up a private or public GitHub repo with GitHub Actions CI.
create_proj(
name,
data_raw = TRUE,
makefile = FALSE,
testthat = FALSE,
use_pipe = FALSE,
add_license = NULL,
license_holder = "Your name",
orcid = NULL,
use_git = TRUE,
create_github_repo = FALSE,
private_repo = TRUE,
ci = "none",
use_renv = TRUE,
use_targets = TRUE,
use_docker = FALSE,
open_proj = FALSE,
verbose = FALSE
)
name |
Character. Name of the new project. Could be a path, e.g.
|
data_raw |
Logical. If TRUE (default), adds a |
makefile |
Logical. If TRUE, adds a template |
testthat |
Logical. If TRUE, adds testthat infrastructure. |
use_pipe |
Logical. If TRUE, adds magrittr's pipe operator to the
package. Default is FALSE since R >= 4.1.0 provides the native pipe
operator |
add_license |
Character. Type of license to add. Options are
|
license_holder |
Character. Name of the license holder / project
author. Also used in CITATION.cff. Default is |
orcid |
Character. ORCID iD of the project author (e.g.
|
use_git |
Logical. If TRUE (default), initializes a local git repository. |
create_github_repo |
Logical. If TRUE, creates a GitHub repository.
Note this requires some working infrastructure like |
private_repo |
Logical. If TRUE (default), the GitHub repo will be private. |
ci |
Character. Type of continuous integration for your GitHub
repository. Options are |
use_renv |
Logical. If TRUE (default), initializes
renv for dependency management.
Creates a lockfile and |
use_targets |
Logical. If TRUE (default), adds a
|
use_docker |
Logical. If TRUE, adds a template |
open_proj |
Logical. If TRUE, opens the newly created RStudio
project in a new session. Default is FALSE — open the |
verbose |
Logical. If TRUE, prints verbose output in the console while creating the new project. Default is FALSE. |
SCIproj creates a research compendium that combines structure (where files live) with workflow (how analyses are reproduced). By default, it sets up:
renv for dependency management (reproducible package versions)
targets for pipeline-based workflow (automatic dependency
tracking and caching)
CITATION.cff for machine-readable citation metadata (FAIR)
DATA_SOURCES.md for data provenance documentation
Since R >= 4.1.0, the native pipe operator |> is available and
recommended over the magrittr pipe %>%. The use_pipe
parameter is therefore set to FALSE by default.
Invisibly returns the path to the new project directory.
## Not run:
library("SCIproj")
# Minimal project (includes renv + targets by default)
create_proj("myproject")
# Names with underscores/hyphens are fine — the R package name is
# auto-cleaned (e.g. "baltic_cod" -> "baltic.cod" in DESCRIPTION)
create_proj("baltic_cod_analysis")
# Full-featured project
create_proj("my_research_project",
add_license = "MIT",
license_holder = "Jane Doe",
orcid = "0000-0001-2345-6789",
create_github_repo = TRUE,
ci = "gh-actions"
)
# Minimal without workflow tools
create_proj("myproject", use_renv = FALSE, use_targets = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.