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. This is also the safer way to use a taxonomy crosswalk as a supplement: run a baseline reconciliation first, then apply reviewed one-to-one crosswalk rows only to names that remain unresolved. Passing a crosswalk through the overrides argument of reconcile_*() applies those rows before the cascade, so they can preempt exact or normalised matches. For the common crosswalk-supplement workflow, use reconcile_crosswalk_supplement() so duplicate source or target candidates are skipped instead of being resolved by row order.

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
# Record acceptance of existing matches after reviewing them
matched <- reconcile_mapping(result)
matched <- utils::head(matched[matched$in_x & matched$in_y, ], 2)
batch <- data.frame(
  name_x = matched$name_x,
  name_y = matched$name_y,
  action = "accept",
  note = "Reviewed existing matches",
  stringsAsFactors = FALSE
)
if (nrow(batch) > 0) {
  result2 <- reconcile_override_batch(result, batch)
}
#> ✔ Override applied: 'Acanthiza apicalis' -> 'Acanthiza_apicalis' (accept)
#> ✔ Override applied: 'Acanthiza chrysorrhoa' -> 'Acanthiza_chrysorrhoa' (accept)
#> ✔ Applied 2 overrides.