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

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.

See also

Author

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

Examples

# Load example data
data("AalborgWWTPs")

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