taxo_path: Get the taxonomic path between two taxa

View source: R/utils.R

taxo_pathR Documentation

Get the taxonomic path between two taxa

Description

Returns the full node-by-node path from one taxon up to their most recent common ancestor (MRCA) and back down to the other taxon. The result is a data frame with one row per node, making it easy to inspect, filter, or pipe into other functions.

Usage

taxo_path(taxon_a, taxon_b, verbose = FALSE)

Arguments

taxon_a

A character string giving the first taxon name.

taxon_b

A character string giving the second taxon name.

verbose

Logical. If TRUE, prints progress messages. Default FALSE.

Value

A data frame of class "taxodist_path" with columns:

node

Character. The clade or taxon name at this step.

depth

Integer. The depth of this node in the full lineage of its side (or the shared lineage for the MRCA).

direction

Character. One of "a" (ascending from taxon A to MRCA), "mrca" (the shared ancestor), or "b" (descending from MRCA to taxon B).

Returns NULL if either taxon cannot be found.

See Also

mrca(), shared_clades(), compare_lineages()

Examples


taxo_path("Tyrannosaurus", "Velociraptor")
taxo_path("Tyrannosaurus", "Homo")


taxodist documentation built on May 6, 2026, 1:06 a.m.