parent: Get id of the parent of some taxa

View source: R/taxo.R

parentR Documentation

Get id of the parent of some taxa

Description

Get id of the parent of some taxa

Usage

parent(taxon_ids, taxo)

parents(taxon_ids, taxo)

Arguments

taxon_ids

internal, numeric ids of the taxa.

taxo

a taxonomy data.frame, typically from extract_taxo().

Details

parent and parents are just synonyms. The function works per taxon but is vectorised over taxon_ids.

Value

A vector of taxon ids, as long as the input, containing the id of the parent of each element in the input.

See Also

Other taxonomy-related functions: ancestors(), as.taxo(), children(), descendants(), extract_taxo(), is_leaf(), lineage(), taxo_id(), taxo_name()

Examples

print(as.Node(taxo), "id")
parent(3, taxo)
parent(1:4, taxo)
parent(c(5, NA), taxo)
## Not run:  parent(12, taxo) 

jiho/ecotaxar documentation built on Jan. 16, 2024, 12:26 a.m.