parent.Rd
Get id of the parent of some taxa
parent(taxon_ids, taxo) parents(taxon_ids, taxo)
taxon_ids | internal, numeric ids of the taxa. |
---|---|
taxo | a taxonomy data.frame, typically from |
A vector of taxon ids, as long as the input, containing the id of the parent of each element in the input.
parent
and parents
are just synonyms. The function works per taxon but is vectorised over taxon_ids
.
Other taxonomy-related functions:
ancestors()
,
as.taxo()
,
children()
,
descendants()
,
extract_taxo()
,
is_leaf()
,
lineage()
,
taxo_id()
,
taxo_name()
#> levelName id #> 1 # NA #> 2 °--living 1 #> 3 ¦--fish 2 #> 4 ¦ °--egg 4 #> 5 °--mollusc 3 #> 6 ¦--snail 5 #> 7 ¦ °--egg 7 #> 8 °--squid 6parent(3, taxo)#> [1] 1parent(1:4, taxo)#> [1] NA 1 1 2#> [1] 3 NAif (FALSE) parent(12, taxo)