Compare a "before" and "after" reconciliation and list every species whose outcome differs: newly matched, newly unresolved, promoted to a higher-confidence match type, or linked to a different target. Useful for:
checking the effect of adding a taxonomy crosswalk or a batch of manual overrides,
comparing two taxonomic authorities (e.g. Catalogue of Life vs GBIF),
auditing changes between runs before and after tightening the fuzzy threshold.
Arguments
- x
A reconciliation object — the "before" state.
- y
A reconciliation object — the "after" state. Must be reconciled against the same
xdata so thatname_xvalues are comparable.- quiet
Logical. Suppresses the console summary when
TRUE. DefaultFALSE.
Value
A list with the following components:
gainedTibble of species matched in
ybut unresolved inx.lostTibble of species matched in
xbut unresolved iny.type_changedTibble of species whose
match_typediffers between the two runs.target_changedTibble of species whose
name_ydiffers.unused_overrides_diffTibble of overrides that are in the
unused_overridesslot of one reconciliation but not the other; columnsname_x,name_y,reason,side("x"or"y").summaryA one-row tibble with counts:
n_gained,n_lost,n_type_changed,n_target_changed,n_shared,n_unused_override_diff.
See also
reconcile_crosswalk() for building an override table from
a published taxonomy crosswalk; reconcile_override_batch() for
applying many hand edits.
Other reconciliation functions:
reconcile_apply(),
reconcile_augment(),
reconcile_crosswalk(),
reconcile_data(),
reconcile_export(),
reconcile_mapping(),
reconcile_merge(),
reconcile_multi(),
reconcile_override(),
reconcile_override_batch(),
reconcile_plot(),
reconcile_report(),
reconcile_review(),
reconcile_splits_lumps(),
reconcile_suggest(),
reconcile_summary(),
reconcile_to_trees(),
reconcile_tree(),
reconcile_trees()
Examples
x <- data.frame(species = c("A a", "A old", "B c"))
tree <- ape::read.tree(text = "((A_a:1,A_new:1):1,B_c:2);")
# Without manual overrides
r1 <- reconcile_tree(x, tree, x_species = "species",
authority = NULL, quiet = TRUE)
# With one manual override
overrides <- data.frame(name_x = "A old", name_y = "A new",
match_type = "manual")
r2 <- reconcile_tree(x, tree, x_species = "species",
authority = NULL, overrides = overrides,
quiet = TRUE)
d <- reconcile_diff(r1, r2, quiet = TRUE)
cat("Gained:", nrow(d$gained), "| Lost:", nrow(d$lost), "\n")
#> Gained: 1 | Lost: 0