taxa_names<- {phyloseq} | R Documentation

## 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)

[Package phyloseq version 1.34.0 Index]