The single source of truth for the candidate sort: the fuzzy distance,
whether the key has occurrence records, the remaining concept scores of
score_candidates() in tier order, publication priority where applicable,
the occurrence count, then the
nomenclatural-validity tiebreak, then the lowest taxonID. Pass group_col to sort within groups first, so
the first row of each group is that group's best candidate.
Arguments
- candidates
A data.frame accepted by
score_candidates(), carrying ataxonIDcolumn and, whengroup_colis given, that column too.- scores
The
score_candidates()output forcandidates, when it has already been computed; recomputed whenNULL.- group_col
Character or
NULL. Column to sort by ahead of the scores.
See also
Other Low-level building blocks:
basionym_placement(),
embed_accepted(),
enrichment_authorship_col(),
is_aggregate_name(),
normalize_aggregate_name(),
normalize_epithets(),
precompute_keys(),
score_candidates()
Examples
candidates <- data.frame(
taxonID = c("2", "1"), taxonomicStatus = c("SYNONYM", "ACCEPTED"),
taxonRank = "SPECIES", is_synonym = c(TRUE, FALSE)
)
candidates[candidate_order(candidates), ]
#> taxonID taxonomicStatus taxonRank is_synonym
#> 2 1 ACCEPTED SPECIES FALSE
#> 1 2 SYNONYM SPECIES TRUE