Learn R Programming

taxlist (version 0.3.0)

parents: Retrieve parents for specific concepts

Description

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

Usage

parents(taxlist, level, ...)

# S4 method for 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

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

# Print names and names of parents
print_name(Easplist, IDs)
print_name(Easplist, parents(Easplist, "genus", IDs))
print_name(Easplist, parents(Easplist, "family", IDs))

Run the code above in your browser using DataLab