sample_names<- | R Documentation |
Replace OTU identifier names
sample_names(x) <- value ## S4 replacement method for signature 'ANY,ANY' sample_names(x) <- value ## S4 replacement method for signature 'ANY,character' sample_names(x) <- value ## S4 replacement method for signature 'otu_table,character' sample_names(x) <- value ## S4 replacement method for signature 'sample_data,character' sample_names(x) <- value ## S4 replacement method for signature 'phyloseq,character' sample_names(x) <- value
x |
(Required). An object defined by the |
value |
(Required). A character vector
to replace the current |
data("esophagus") sample_names(esophagus) # plot_tree(esophagus, color="sample_names", ladderize="left") sample_names(esophagus) <- paste("Sa-", sample_names(esophagus), sep="") sample_names(esophagus) # plot_tree(esophagus, color="sample_names", ladderize="left") ## non-characters are first coerced to characters. sample_names(esophagus) <- 1:nsamples(esophagus) sample_names(esophagus) # plot_tree(esophagus, color="sample_names", ladderize="left") ## Cannot assign non-unique or differently-lengthed name vectors. Error. # sample_names(esophagus) <- sample(c(TRUE, FALSE), nsamples(esophagus), TRUE) # sample_names(esophagus) <- sample(sample_names(esophagus), nsamples(esophagus)-1, FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.