Given a starting TSN and a taxonomy table, walk up the parentTsn
chain to the root, returning all TSNs on that path (including the start).
Usage
collect_lineage(start_tsn, tax_tbl)
Arguments
- start_tsn
A single TSN (numeric or character).
- tax_tbl
A data frame with at least tsn and parentTsn
columns.
Value
A character vector of TSNs from start_tsn up to the root.
Details
Cycles are guarded against by tracking visited nodes.