| Type: | Package |
| Title: | Creates a Scientific Project Skeleton as an R Package |
| Version: | 1.0.0 |
| 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. |
| Language: | en-US |
| License: | MIT + file LICENSE |
| Depends: | R(≥ 4.1.0) |
| Imports: | usethis (≥ 2.0.0), rstudioapi |
| Suggests: | knitr, renv, rmarkdown, targets, testthat (≥ 3.0.0), withr |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| RoxygenNote: | 7.3.3 |
| Encoding: | UTF-8 |
| URL: | https://github.com/saskiaotto/SCIproj |
| BugReports: | https://github.com/saskiaotto/SCIproj/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-03-13 14:49:55 UTC; saskiaotto |
| Author: | Saskia Otto |
| Maintainer: | Saskia Otto <saskia.a.otto@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-18 10:50:10 UTC |
SCIproj package
Description
Generic template for research projects structured as R packages. This package works as a template for new research projects, under the idea of having everything (data, R scripts, functions and manuscripts) contained in the same package to promote reproducible research.
Details
For detailed steps on how to use the package see https://github.com/saskiaotto/SCIproj/blob/main/README.md.
Author(s)
Saskia A. Otto
See Also
Useful links:
Clean a directory name into a valid R package name
Description
Converts underscores and hyphens to dots and removes other invalid characters. R package names may only contain letters, numbers, and dots, must start with a letter, and must not end with a dot.
Usage
clean_pkg_name(name)
Arguments
name |
Character. The directory name to clean. |
Value
A valid R package name.
Create new data analysis project as R package
Description
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.
Usage
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
)
Arguments
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. |
Details
SCIproj creates a research compendium that combines structure (where files live) with workflow (how analyses are reproduced). By default, it sets up:
-
renvfor dependency management (reproducible package versions) -
targetsfor pipeline-based workflow (automatic dependency tracking and caching) -
CITATION.cfffor machine-readable citation metadata (FAIR) -
DATA_SOURCES.mdfor 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.
Value
Invisibly returns the path to the new project directory.
Examples
## 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)