boilerplate_batch_edit_multi {boilerplate} | R Documentation |
Batch Edit Multiple Fields at Once
Description
This function allows editing multiple fields across multiple entries in a single operation.
Usage
boilerplate_batch_edit_multi(
db,
edits,
category = NULL,
preview = FALSE,
confirm = TRUE,
quiet = FALSE
)
Arguments
db |
List. The database to edit. |
edits |
List of lists. Each sub-list should contain:
|
category |
Character. Category to edit if db is unified. |
preview |
Logical. If TRUE, shows what would be changed. |
confirm |
Logical. If TRUE, asks for confirmation. |
quiet |
Logical. If TRUE, suppresses messages. |
Value
List. The modified database with the batch edits applied.
Examples
# First create a sample database
unified_db <- list(
measures = list(
ban_hate_speech = list(reference = "old_ref", waves = "1-10"),
born_nz = list(reference = "old_ref", waves = "1-10")
)
)
# Update multiple fields for specific entries
unified_db <- boilerplate_batch_edit_multi(
db = unified_db,
edits = list(
list(
field = "reference",
new_value = "sibley2021",
target_entries = c("ban_hate_speech", "born_nz")
),
list(
field = "waves",
new_value = "1-15",
target_entries = c("ban_hate_speech", "born_nz")
)
),
category = "measures"
)
[Package boilerplate version 1.3.0 Index]