Skip to contents

A convenience wrapper around reconcile_override() for curated batches of manual decisions.

Usage

reconcile_override_batch(reconciliation, overrides, quiet = FALSE)

Arguments

reconciliation

A reconciliation object returned by reconcile_tree(), reconcile_data(), or a related matcher.

overrides

A data frame, or a length-1 character vector giving the path to a CSV file with the same columns:

name_x (required)

The original name in source x (your data).

action

One of "accept" (default), "reject", "replace". See reconcile_override() for the semantics.

name_y

The target name in source y; required for "accept" and "replace".

note

Optional free-text justification.

quiet

Logical. Suppresses per-override success messages when TRUE. Default FALSE.

Value

An updated reconciliation object with all overrides applied.

Details

Typical workflow: generate a CSV of corrections (by hand, or with the help of reconcile_suggest()), check it into version control, and apply it on every run so the corrections are reproducible and reviewable.

Examples

data(avonet_subset)
data(tree_jetz)
result <- reconcile_tree(avonet_subset, tree_jetz,
                         x_species = "Species1", authority = NULL)
#>  Reconciling 919 data names vs 657 tree tips
#>  Matching 919 x 657 names through 2 stages...
#>  Stage 1/2: Exact matching...
#>  Stage 2/2: Normalised matching (0 matched so far)...
#>  Matched 657/919 data names to tree tips
# Create a batch of overrides
batch <- data.frame(
  name_x = reconcile_mapping(result)$name_x[
    reconcile_mapping(result)$match_type == "unresolved" &
    reconcile_mapping(result)$in_x][1:2],
  name_y = tree_jetz$tip.label[1:2],
  action = "accept",
  note = "Batch demo",
  stringsAsFactors = FALSE
)
batch <- batch[!is.na(batch$name_x), ]
if (nrow(batch) > 0) {
  result2 <- reconcile_override_batch(result, batch)
}
#>  Override applied: 'Acanthiza cinerea' -> 'Amytornis_barbatus' (accept)
#>  Override applied: 'Calamanthus cautus' -> 'Amytornis_merrotsyi' (accept)
#>  Applied 2 overrides.