Skip to contents

Retrieve IDs of parents for selected taxa in a taxonomic list.

Usage

parents(taxlist, level, ...)

# S4 method for class 'taxlist,character'
parents(taxlist, level, concept, ...)

Arguments

taxlist

An object of class taxlist containing a taxonomic list.

level

A character value indicating the level at which the parents will be extracted (upwards in the taxonomic ranks).

...

Further arguments passed among methods.

concept

A vector containing concept IDs. The taxa for which the parents will be retrieved. If not provided, parents for every single taxon concept in 'taxlist' will be retrieved.

Examples

# Random selection of 5 taxa
IDs <- sample(Easplist@taxonRelations$TaxonConceptID, 5)

# Print names and names of parents
print_name(Easplist, IDs)
#> [1] "*Prosopis* L."                      "*Clerodendrum tanganyikense* Baker"
#> [3] "*Tephrosia villosa* (L.) Pers."     "*Cerastium* L."                    
#> [5] "*Crossandra* Salisb."              
print_name(Easplist, parents(Easplist, "genus", IDs))
#> [1] "*Prosopis* L."        "*Clerodendrum* L."    "*Tephrosia* Pers."   
#> [4] "*Cerastium* L."       "*Crossandra* Salisb."
print_name(Easplist, parents(Easplist, "family", IDs))
#> [1] "*Leguminosae* Juss."  "*Lamiaceae* Martinov" "*Leguminosae* Juss." 
#> [4] "*Caryophyllaceae* "   "*Acanthaceae* Juss."