Description Usage Arguments Value Examples
Create an ordered relative abundance plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
df |
Dataframe containing metadata and taxon (Phylum, Otu, etc) abundance data in 'long' format, e.g. using |
df_obs |
An optional dataframe containing individual observations, when |
taxon |
Which taxonomic level within |
yvar |
Variable to use on the y-axis. Defaults to |
title |
String to use as plot title. Defaults to an empty string. |
error_bar |
Boolean for whether to include an errorbar. If so, |
facet_var |
Variable to use for faceted plots. By default, no faceting will be used. |
fill |
Optional variable to use for fill color. Common use cases include filling by Phylum, Sample_name, or Sample_type. |
phy_vec |
Optional vector containing the unique Phyla resulting from |
fill_pal |
An optional user-defined palette for maintaining consistent fill colors across RA plots. Best when combined with |
gtxt |
Boolean for whether to include a |
seed |
Integer to be used as a random seed to ensure reproducibility. For example, this would come into play if using |
A ggplot created based on df
and the specified parameters. It can be further modified with additional layers.
1 2 3 4 5 6 7 8 9 10 11 12 | plot_ra(mock_df, title = "Cross-Comparison of Mock Control Replicates", yvar = "Percentage",
facet_var = "Sample", fill = "Phylum", gtxt = T)
plot_ra(samp_df, title = "Exp1 & 2 Stomachs by Treatment, Ordered by Untreated",
facet_var = "Group", fill = "Phylum", error_bar = T)
plot_ra(df = otu_agg, df_obs = otu_obs, title = "Feces Samples, Ordered by Day 0",
facet_var = "Day", fill = "Phylum")
plot_ra(df = phy_agg, df_obs = phy_obs, taxon = "Phylum",
title = "Feces Samples, Aggregated by Phylum, Ordered by Day 0",
facet_var = "Day", fill = "Phylum", phy_vec = phy_rank$Phylum, fill_pal = phy_pal)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.