Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tax_table-methods

Build or access the taxonomyTable.


Description

This is the suggested method for both constructing and accessing a table of taxonomic names, organized with ranks as columns (taxonomyTable-class). When the argument is a character matrix, tax_table() will create and return a taxonomyTable-class object. In this case, the rows should be named to match the species.names of the other objects to which it will ultimately be paired. Alternatively, if the first argument is an experiment-level (phyloseq-class) object, then the corresponding taxonomyTable is returned. Like other accessors (see See Also, below), the default behavior of this method is to stop with an error if object is a phyloseq-class but does not contain a taxonomyTable.

Usage

tax_table(object, errorIfNULL=TRUE)

## S4 method for signature 'ANY'
tax_table(object, errorIfNULL = TRUE)

## S4 method for signature 'matrix'
tax_table(object)

## S4 method for signature 'data.frame'
tax_table(object)

Arguments

object

An object among the set of classes defined by the phyloseq package that contain taxonomyTable.

errorIfNULL

(Optional). Logical. Should the accessor stop with an error if the slot is empty (NULL)? Default TRUE.

Value

A taxonomyTable-class object. It is either grabbed from the relevant slot if object is complex, or built anew if object is a character matrix representing the taxonomic classification of species in the experiment.

See Also

Examples

#
# tax1 <- tax_table(matrix("abc", 30, 8))
# data(GlobalPatterns)
# tax_table(GlobalPatterns)

phyloseq

Handling and analysis of high-throughput microbiome census data

v1.34.0
AGPL-3
Authors
Paul J. McMurdie <joey711@gmail.com>, Susan Holmes <susan@stat.stanford.edu>, with contributions from Gregory Jordan and Scott Chamberlain
Initial release
2019-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.