| Title: | Creates a Scientific Project Skeleton as an R Package |
|---|---|
| Description: | Provides a template for new research projects structured as an R package-based research compendium. Everything - data, R scripts, custom functions and manuscript or reports - is contained within the same package to facilitate collaboration and promote reproducible research, following the FAIR principles. |
| Authors: | Saskia Otto [aut, cre, cph] (ORCID: <https://orcid.org/0000-0001-7780-1322>) |
| Maintainer: | Saskia Otto <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1 |
| Built: | 2026-05-22 18:55:33 UTC |
| Source: | https://github.com/saskiaotto/sciproj |
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, use_rproj = TRUE, setwd_to_proj = TRUE, open_proj = FALSE, verbose = FALSE )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, use_rproj = TRUE, setwd_to_proj = TRUE, 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 |
use_rproj |
Logical. If TRUE (default), creates an RStudio project
file ( |
setwd_to_proj |
Logical. If TRUE (default), sets the working
directory to the new project after creation so you can continue
working inside it. Ignored when |
open_proj |
Logical. If TRUE, opens the newly created project in
a new RStudio or Positron session (ignored in other IDEs). In that
case, the current session keeps its original working directory,
regardless of |
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)## 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)