mutate-phyloseq | R Documentation |
These functions are wrappers around dplyr::mutate()
and
dplyr::transmute()
that provide convenient ways to modify tax_table(x)
and sample_data(x)
as well as the sample and taxa names.
mutate_tax_table(x, ...)
## S4 method for signature 'taxonomyTable'
mutate_tax_table(x, ...)
## S4 method for signature 'phyloseq'
mutate_tax_table(x, ...)
transmute_tax_table(x, ...)
## S4 method for signature 'taxonomyTable'
transmute_tax_table(x, ...)
## S4 method for signature 'phyloseq'
transmute_tax_table(x, ...)
mutate_sample_data(x, ...)
## S4 method for signature 'sample_data'
mutate_sample_data(x, ...)
## S4 method for signature 'phyloseq'
mutate_sample_data(x, ...)
transmute_sample_data(x, ...)
## S4 method for signature 'sample_data'
transmute_sample_data(x, ...)
## S4 method for signature 'phyloseq'
transmute_sample_data(x, ...)
x |
A |
... |
Expressions passed to |
When modifying the taxonomy table, the .otu
column name can be used to set
new taxa names.
When modifying the sample data, the .sample
column name can be used to set
new taxa names.
The experimental arguments to dplyr::mutate()
of .keep
, .before
, and
.after
are not currently supported and may result in errors or unexpected
behavior.
data(GlobalPatterns)
ps <- GlobalPatterns %>%
transmute_sample_data(SampleType, sample_sum = sample_sums(.)) %>%
filter_sample_data(SampleType %in% c("Feces", "Skin", "Tongue")) %>%
filter_tax_table(Kingdom == "Bacteria") %>%
tax_glom("Phylum") %>%
transmute_tax_table(Kingdom, Phylum, .otu = Phylum)
sample_data(ps)
tax_table(ps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.