Skip to contents

This function extracts a specific category from two unified databases, merges them, and returns the updated first database with the merged category.

Usage

boilerplate_merge_category(
  db1,
  db2,
  category,
  db1_name = "Database 1",
  db2_name = "Database 2",
  recursive = TRUE,
  sort_results = TRUE,
  quiet = FALSE
)

Arguments

db1

A list representing the first unified database.

db2

A list representing the second unified database.

category

Character. The category to merge (e.g., "measures", "methods").

db1_name

Character string. The name of the first database (default: "Database 1").

db2_name

Character string. The name of the second database (default: "Database 2").

recursive

Logical. Whether to merge hierarchical structures recursively (default: TRUE).

sort_results

Logical. Whether to sort the merged database alphabetically (default: TRUE).

quiet

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

Value

A list representing the first database with the updated merged category.

Examples

if (FALSE) { # \dontrun{
# Import two unified databases
db1 <- boilerplate_import()
db2 <- boilerplate_import(data_path = "path/to/other/project/data")

# Merge just the measures category
db1 <- boilerplate_merge_category(db1, db2, "measures")

# Save the updated database
boilerplate_save(db1)
} # }