amp_rarecurve: Rarefaction curve

View source: R/amp_rarecurve.R

amp_rarecurveR Documentation

Rarefaction curve

Description

Generates a rarefaction curve (number of reads vs number of observed OTUs) for each sample.

Usage

amp_rarecurve(
  data,
  stepsize = 1000,
  color_by = NULL,
  facet_by = NULL,
  facet_scales = "fixed"
)

amp_rarefaction_curve(
  data,
  stepsize = 1000,
  color_by = NULL,
  facet_by = NULL,
  facet_scales = "fixed"
)

Arguments

data

(required) Data list as loaded with amp_load.

stepsize

Step size for the curves. Lower is prettier but takes more time to generate. (default: 1000)

color_by

Color curves by a variable in the metadata. (default: NULL)

facet_by

Split the plot into subplots based on a variable in the metadata. (default: NULL)

facet_scales

If facet_by is set, should the axis scales of each subplot be fixed (fixed), free ("free"), or free in one dimension ("free_x" or "free_y")? (default: "fixed")

Value

A ggplot2 object.

Author(s)

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

See Also

amp_load, amp_octave

Examples

# Load example data
data("AalborgWWTPs")

# Rarecurve
amp_rarecurve(AalborgWWTPs, facet_by = "Plant")

MadsAlbertsen/ampvis2 documentation built on Jan. 28, 2024, 7:12 a.m.