stacked_barplot: Stacked Barplot

Description Usage Arguments Value See Also Examples

View source: R/barplot.R

Description

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.

Usage

1
2
3
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

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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
}

## End(Not run)

vallenderlab/MicrobiomeR documentation built on Aug. 30, 2019, 11:24 p.m.