Description Usage Arguments Value Examples
Takes either a phyloq-object or an (edited) result of prep_bar
as an input. And
creates a per-sample barplot.
1 2 3 4 5 6 7 8 9 | create_bar(
ps = NULL,
df_topn = NULL,
id = "sample_id",
n = 15,
ncol_legend = 3,
name_legend = "OTU",
RA = TRUE
)
|
ps |
phyloseq-object (optional) |
df_topn |
topn-data.frame (result of |
id |
name of the 'id'-column (default: 'sample_id') |
n |
number of OTUs/ASVs to plot |
ncol_legend |
number of columns in the legend |
name_legend |
name of the legend |
RA |
specify whether or not the phyloseq is based on relative abundances (logical). Default: TRUE |
returns a per-sample barplot showing the n most abundant OTUs.
1 2 3 4 5 | data(ps_NP)
ps_NP %>%
phyloseq::subset_samples(visit_name == "w1" & birth_mode == "vag") %>%
create_bar() +
ggplot2::coord_flip()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.