Skip to contents

Draw a one-glance bar or pie chart of how species names were resolved (exact, normalised, synonym, fuzzy, flagged, manual, unresolved). Uses base R graphics only, so no additional packages are required.

Usage

reconcile_plot(reconciliation, type = c("bar", "pie"), ...)

Arguments

reconciliation

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

type

A length-1 character vector. Plot style:

"bar" (default)

Horizontal stacked bar chart. Best for slides, reports, and scripting.

"pie"

Pie chart. Useful when the match types are roughly balanced.

...

Additional arguments passed on to graphics::barplot() or graphics::pie() (e.g. main, col, border).

Value

The input reconciliation, invisibly, so you can use the function in a pipe.

Examples

data(avonet_subset)
data(tree_jetz)
rec <- 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
reconcile_plot(rec)

reconcile_plot(rec, type = "pie")