Skip to contents

This function initializes or updates a specific boilerplate database category with default values.

Usage

boilerplate_init_category(
  category,
  merge_strategy = c("keep_existing", "merge_recursive", "overwrite_all"),
  data_path = NULL,
  quiet = FALSE,
  dry_run = FALSE,
  create_dirs = FALSE,
  confirm = TRUE,
  create_empty = TRUE
)

Arguments

category

Character. Category to initialize. Options include "measures", "methods", "results", "discussion", "appendix", "template".

merge_strategy

Character. How to merge with existing database: "keep_existing", "merge_recursive", or "overwrite_all".

data_path

Character. Base path for data directory. If NULL (default), uses here::here("boilerplate", "data").

quiet

Logical. If TRUE, suppresses all CLI alerts. Default is FALSE.

dry_run

Logical. If TRUE, simulates the operation without writing files. Default is FALSE.

create_dirs

Logical. If TRUE, creates directories that don't exist. Default is FALSE.

confirm

Logical. If TRUE, asks for confirmation before making changes. Default is TRUE.

create_empty

Logical. If TRUE, creates empty database structures with just the template headings. Default is TRUE. Set to FALSE to use default content.

Value

Logical. TRUE if initialization was successful, FALSE if canceled.

Examples

if (FALSE) { # \dontrun{
# initialize the methods database with empty structure
boilerplate_init_category("methods", create_dirs = TRUE, create_empty = TRUE)

# initialize measures database with recursive merging and default content
boilerplate_init_category(
  category = "measures",
  merge_strategy = "merge_recursive",
  create_dirs = TRUE,
  create_empty = FALSE
)
} # }