Description Usage Arguments Value Examples
View source: R/plot_composition.R
Plot taxon abundance for samples.
1 2 3 4 5 6 7 8 9 10 11 |
x |
|
sample.sort |
Order samples. Various criteria are available:
|
otu.sort |
Order taxa. Same options as for the sample.sort argument but instead of metadata, taxonomic table is used. Also possible to sort by 'abundance'. |
x.label |
Specify how to label the x axis. This should be one of the variables in sample_variables(x). |
plot.type |
Plot type: 'barplot' or 'heatmap' |
verbose |
verbose
(but not in sample/taxon ordering).
The options are 'Z-OTU', 'Z-Sample', 'log10' and 'compositional'.
See the |
average_by |
Average the samples by the average_by variable |
group_by |
Group by this variable (in plot.type "barplot") |
... |
Arguments to be passed (for |
A ggplot
plot object.
1 2 3 4 5 6 7 8 9 | library(dplyr)
data(atlas1006)
pseq <- atlas1006 %>%
subset_samples(DNA_extraction_method == "r") %>%
aggregate_taxa(level = "Phylum") %>%
transform(transform = "compositional")
p <- plot_composition(pseq, sample.sort = "Firmicutes",
otu.sort = "abundance", verbose = TRUE) +
scale_fill_manual(values = default_colors("Phylum")[taxa(pseq)])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.