Create a stacked barplot to show relative abundance of taxa. convert_proportions
converts the dataframe abundance values to percent 100 and returns a transformed dataframe.
melt_metacoder
melts the metacoder or phyloseq tables into a dataframe and returns a melted dataframe. stacked_barplots
creates a stacked barplots for multiple taxonomic levels and returns a list of stacked barplots.
stacked_barplot(obj, tax_level = "Phylum", fill = "Phylum", xlabel = "Samples", faceted = FALSE, title = NULL, palette_values = NULL)
obj | An object to be converted to a taxmap object with |
---|---|
tax_level | The taxonomic level, Default: 'Phylum' |
fill | The taxonomic level by which the bars are filled, Default: 'Phylum' |
xlabel | The label of the x axis, Default: 'Samples' |
faceted | A boolean to determine if the barplot should be faceted by TreatmentGroup |
title | The title or name of the plot. |
palette_values | A list of the colors to input to be mapped to the plot palette, Default: 'NULL' |
Returns a stacked barplot.
Other Visualizations: alpha_diversity_plot
,
correlation_data
,
correlation_plots
,
correlation_plot
,
heat_tree_parameters
,
heat_tree_plots
,
ordination_plots
,
ordination_plot
, plot_limits
,
save_alpha_diversity_plots
,
save_correlation_plots
,
save_heat_tree_plots
,
save_ordination_plots
,
save_stacked_barplots
,
stacked_barplots
,
top_coefficients_barplot
# NOT RUN { if (interactive()) { # An example stacked bar plot library(MicrobiomeR) data <- analyzed_silva palette <- get_color_palette(color_no = 12) plot <- stacked_barplot(obj = data, palette_values = palette) plot } # }