Wraps wflow_start to create a standard workflowr
project, then extends it with a themed color scheme, structured Rmd analysis
pipeline, utility scripts, and a Quarto report template.
Usage
reflow_init(
directory,
name = NULL,
author = "Author Name",
email = NULL,
affiliation = NULL,
orcid = NULL,
website = NULL,
scheme = c("basic", "clinical", "code", "special", "other"),
depth = c("standard", "minimal", "extended"),
seed = as.integer(format(Sys.Date(), "%Y%m%d")),
github_url = NULL,
existing = FALSE,
git = TRUE,
change_wd = rlang::is_interactive(),
user.name = NULL,
user.email = NULL,
open = rlang::is_interactive()
)Arguments
- directory
Character. Path where the project will be created. Passed directly to
workflowr::wflow_start().- name
Character. Project name (used in titles and navbar). If
NULL, derived from the directory basename.Character. Full name of the primary author.
Character. Author's email address (optional).
- affiliation
Character. Author's institutional affiliation (optional).
- orcid
Character. Author's ORCID iD (optional, format: "0000-0000-0000-0000").
- website
Character. URL to author's or project website (optional).
- scheme
Character. Color scheme to apply. One of
"clinical","basic","code","special","other". Defaults to"basic".- depth
Character. Rmd pipeline depth. One of
"minimal","standard","extended". Defaults to"standard".- seed
Integer. Random seed for workflowr reproducibility. Defaults to
as.integer(format(Sys.Date(), "%Y%m%d")).- github_url
Character. GitHub repository URL (optional). Adds a GitHub link to the navbar.
- existing
Logical. Is the
directoryan existing project? Passed toworkflowr::wflow_start(existing = ...). DefaultFALSE.- git
Logical. Initialize git repository and make first commit? Default
TRUE.- change_wd
Logical. Change working directory to the new project? Default
TRUEin interactive sessions.- user.name
Character. Git user name (optional). Passed to
workflowr::wflow_start().- user.email
Character. Git user email (optional). Passed to
workflowr::wflow_start().- open
Logical. Open the project in RStudio after creation? Default
TRUEin interactive sessions.
Details
The function proceeds in two phases:
Phase 1 – workflowr base: Calls workflowr::wflow_start()
with git = FALSE to create the standard workflowr scaffold without
committing yet.
Phase 2 – reflowR theming: Replaces _site.yml,
index.Rmd, and about.Rmd with themed versions; adds the
analysis pipeline Rmd files, CSS/SCSS, icon, setup script, utility script,
Quarto report template, and additional subdirectories. If git = TRUE,
initializes git and commits all files.
See also
wflow_start for the underlying project creation,
wflow_build to render Rmd files,
wflow_publish to commit + build + commit,
reflow_schemes and reflow_presets for available options.
Examples
if (FALSE) { # \dontrun{
library(reflowR)
# Clinical trial project with full pipeline
reflow_init(
directory = "~/projects/sepsis_trial",
author = "Raban Heller",
email = "raban.heller@outlook.com",
scheme = "clinical",
depth = "standard"
)
# Quick stats project
reflow_init(
directory = "~/projects/simulation_study",
author = "Raban Heller",
scheme = "code",
depth = "minimal"
)
# Then use standard workflowr commands:
workflowr::wflow_build()
workflowr::wflow_publish("analysis/*.Rmd", message = "Initial build")
} # }