taxlist (version 0.1.7)

tax2traits: Set Taxonomic Information as Taxon Traits

Description

Taxonomic classification can be included in '>taxlist objects within the information provided at slot 'taxonRelations'. Nevertheless, for statistical analyses it may be more convenient to insert such information in the slot 'taxonTraits'.

Usage

# S4 method for taxlist
tax2traits(object, get_names=FALSE, ...)

Arguments

object

An object of class '>taxlist.

get_names

Logical value indicating whether taxon names should be retrieved instead of taxon IDs

...

Further arguments to be passed among methods.

Value

An object of class '>taxlist with taxonomy added as traits.

Details

This function can only be applied to objects containing parent-child relationships and information on taxonomic levels.

Examples

Run this code
# NOT RUN {
library(taxlist)
data(Easplist)

## Family Acanthaceae with children
Acanthaceae <- subset(Easplist, TaxonName == "Acanthaceae", slot="names",
	keep_children=TRUE)
summary(Acanthaceae)

## Insert taxonomy to taxon traits
Acanthaceae <- tax2traits(Acanthaceae, get_names=TRUE)
head(taxon_traits(Acanthaceae))
# }

Run the code above in your browser using DataLab