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

assign-taxa_names

Replace OTU identifier names


Description

Replace OTU identifier names

Usage

taxa_names(x) <- value

## S4 replacement method for signature 'ANY,ANY'
taxa_names(x) <- value

## S4 replacement method for signature 'ANY,character'
taxa_names(x) <- value

## S4 replacement method for signature 'otu_table,character'
taxa_names(x) <- value

## S4 replacement method for signature 'taxonomyTable,character'
taxa_names(x) <- value

## S4 replacement method for signature 'phylo,character'
taxa_names(x) <- value

## S4 replacement method for signature 'XStringSet,character'
taxa_names(x) <- value

## S4 replacement method for signature 'phyloseq,character'
taxa_names(x) <- value

Arguments

x

(Required). An object defined by the phyloseq-package that describes OTUs in some way.

value

(Required). A character vector to replace the current taxa_names.

Examples

data("esophagus")
taxa_names(esophagus)
# plot_tree(esophagus, label.tips="taxa_names", ladderize="left")
taxa_names(esophagus) <- paste("OTU-", taxa_names(esophagus), sep="")
taxa_names(esophagus)
# plot_tree(esophagus, label.tips="taxa_names", ladderize="left")
## non-characters are first coerced to characters.
taxa_names(esophagus) <- 1:ntaxa(esophagus)
taxa_names(esophagus)
# plot_tree(esophagus, label.tips="taxa_names", ladderize="left")
## Cannot assign non-unique or differently-lengthed name vectors. Error.
# taxa_names(esophagus) <- sample(c(TRUE, FALSE), ntaxa(esophagus), TRUE)
# taxa_names(esophagus) <- sample(taxa_names(esophagus), ntaxa(esophagus)-5, FALSE)

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.