Skip to contents

This function is deprecated. Use boilerplate_copy_from_project instead for better project-based workflow.

Usage

boilerplate_merge_databases(
  db1,
  db2,
  db1_name = "Database 1",
  db2_name = "Database 2",
  recursive = TRUE,
  sort_results = TRUE
)

Arguments

db1

A list representing the first measure database.

db2

A list representing the second measure database.

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).

Value

A list representing the merged measure database.

Details

This function merges two measure databases, allowing the user to resolve conflicts when the same measure exists in both databases with different content. It supports both flat and hierarchical database structures.

The function iterates through all measures in both databases. When a measure exists in both databases:

  • If the entries are identical, it keeps one copy.

  • If the entries differ, it prompts the user to choose which entry to keep.

Measures that exist in only one database are automatically added to the merged database. If recursive is TRUE, the function will recursively merge nested folders/categories. If sort_results is TRUE, the function will sort the merged database alphabetically at each level.

Examples

# \donttest{
# This function is deprecated. Use boilerplate_copy_from_project() instead.
# Example usage (for reference only):
# merged <- boilerplate_merge_databases(db1, db2, "Study 1", "Study 2")
# }