Skip to contents

Generate a ggplot2 stacked barplot from a relative abundance table.

Usage

bar_plot(
  rel_abund_tb,
  x_var = "sample_id",
  position = "stack",
  width = 1,
  color = NULL,
  true_line = FALSE,
  italics = FALSE,
  global_colours = NULL
)

Arguments

rel_abund_tb

A relative abundance table in tibble format.

x_var

The x variable for plotting.

position

"fill" or "stack", should the plotting area be filled in.

width

The width of the bar.

color

A variable to color bars by.

true_line

Logical, whether to show a true abundance line.

italics

Logical, whether to italicize taxon.

global_colours

The global colour scheme as a named vector.

Value

A ggplot object.

Examples

rel_abund_phy(physeq) %>% bar_plot()