plotgg_taxon: Plot single taxon.

View source: R/plotgg_taxon.r

plotgg_taxonR Documentation

Plot single taxon.

Description

Make a box and whiskers plot of a single taxon, while grouping by a variable.

Usage

plotgg_taxon(...)

## Default S3 method:
plotgg_taxon(
  Tab,
  Map,
  taxon,
  x,
  col = NULL,
  var.name = "Abundance",
  theme = theme_blackbox()
)

## S3 method for class 'Dataset'
plotgg_taxon(
  Dat,
  taxon,
  x,
  col = NULL,
  var.name = "Abundance",
  theme = theme_blackbox()
)

Arguments

Tab

Matrix with samples as columns and taxa as rows.

Map

Data frame with metadata for Tab. Each row must correspond to a sample in Tab, they must be in the same order, and be named with the same names as the columns in Tab

taxon

String indicating which taxon to plot.

x

String indicating which variable to use as the x-axis in the plot. Should correspond to a header name in Map

col

String indicating which variable to use to color the plot. Can be the same or different as x. It should correspond to a header name in Map.

var.name

y-axis label on the plot.

theme

A ggplot2 theme to be used woth the plot.

Dat

A Dataset object.

Value

A ggplot2 plot

Author(s)

Sur Herrera Paredes

See Also

plotgg_var

Examples

data(Rhizo)
data(Rhizo.map)
data(Rhizo.tax)
Dat <- create_dataset(Rhizo,Rhizo.map,Rhizo.tax)

# Passing independently an abundance table and mapping file
plotgg_taxon(Tab = Dat$Tab, Map = Dat$Map,
             taxon = "OTU_14834", x = "fraction")
plotgg_taxon(Tab = Dat$Tab, Map = Dat$Map,
             taxon = "OTU_14834", x = "fraction",
             col = "accession")

# Passing a dataset object
plotgg_taxon(Dat, taxon = "OTU_14834",
             x = "fraction")
plotgg_taxon(Dat, taxon = "OTU_14834",
             x = "fraction",
             col = "accession")

surh/AMOR documentation built on Feb. 21, 2023, 6:31 a.m.