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)

Arguments

obj

An object to be converted to a taxmap object with create_taxmap.

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'

Value

Returns a stacked barplot.

See also

Examples

# 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
}
# }