lineage_depth: Get the lineage depth of a taxon

View source: R/distance.R

lineage_depthR Documentation

Get the lineage depth of a taxon

Description

Returns the number of nodes in the lineage of a taxon, from root to tip. This reflects how deeply nested the taxon is within the taxonomic hierarchy.

Usage

lineage_depth(taxon, verbose = FALSE)

Arguments

taxon

A character string giving the taxon name.

verbose

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

Value

An integer giving the lineage depth, or NULL if the taxon cannot be found.

Examples


lineage_depth("Tyrannosaurus")   # deep — many intermediate clades
lineage_depth("Biota")           # shallow — near root


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