Learn R Programming

RAM (version 1.2.1.3)

OTU.ord: Ordination Plot For OTUs Using CCA or RDA Analysis

Description

This function consumes an OTU table, metadata factors, and graphing options, then produces a plot showing the cca or rda analysis of the OTU table.

Usage

OTU.ord(otu, meta=meta, factors=NULL, group=NULL, na.action=c("na.fail", "na.omit", "na.exclude"), rank="g", taxa=NULL, data.trans="total", plot.species=TRUE, plot.scaling=-1, biplot.scale=NULL, biplot.sig=NULL, biplot.label= TRUE, mode=c("rda", "cca"), choice=c(1,2), main="", cex.point=3, cex.leg=12, cex.bp=3, file=NULL, ext=NULL, width=10, height=10)

Arguments

otu
the OTU table to be used.
meta
the metadata table to be used.
factors
a named character vector of length 1 or 2 specifying metadata factors for the samples in the OTU table (see Details).
group
a named character vector of length 1 or 2 specifying metadata factors for the samples in the OTU table (see Details).
na.action
choice of one of the following: "na.fail", "na.omit" or "na.exclude", see na.action in cca for detail.
rank
the rank to select the taxon groups at.
taxa
an integer or a character vector of taxa names at the given rank. If it's an integer, will display the top most abundant taxa; if it's a vector of taxa names, will plot the selected taxa.
data.trans
a method used to standardize the OTU table. One of "total", "max", "freq", "normalize", "range", "standardize", "pa", "chi.square", "hellinger" or "log" (see ?decostand).
plot.species
whether plot sites or taxa, should be reflex to plot.scaling
plot.scaling
one of the following: 1, 2, 3, or -1. See scaling in plot.cca for detail. See also ordiplot
biplot.scale
a numeric number, length of the biplot arrows
biplot.sig
significance cutoff for biplot to be displayed. Currently disabled because in the function, calculated ordination model cannot be passed to anova test.
biplot.label
whether or not to plot biplot
mode
one of the following: "cca" or "rda".
choice
the chosen axes
main
title of the plot
cex.point
size of points
cex.leg
size of lengend name
cex.bp
size of biplot labels
file
the file path where the image should be created (see ?RAM.plotting).
ext
the file type to be used; one of "pdf", "png", "tiff", "bmp", "jpg", or "svg".
width
the width of the image to be created (in inches).
height
the height of the image to be created (in inches).

Value

return a list of following: 1) ggplot object; 2) ordination model; 3) commodity data and 4) metadata used for the ordination model.

Details

group should be a named character vector specifying the names of the columns to be used from meta (see RAM.factors). The values on the axes denote what fraction of the sum of all eigenvalues (i.e. from all axes) is explained by that (single) axis.

See Also

decostand, Taxa.ord, pcoa.plot

Examples

Run this code
data(ITS1, meta)
its1<- filter.OTU(data=list(ITS1=ITS1), percent=0.001)[[1]]
factors=c("City", "Crop", "Harvestmethod", "Ergosterol_ppm")
## Not run: 
# # plot sites
# ord1 <- OTU.ord(its1,  meta=meta, data.trans="total",
#         factors=factors, mode="cca", biplot.sig=0.1,
#         taxa=20, biplot.scale=1.5, cex.point=5,
#         plot.species=FALSE, rank="f", plot.scaling=3,
#         group=c(City="City", Crop="Crop"))
# # plot taxa
# ord2 <- OTU.ord(its1,  meta=meta, data.trans="total", 
#         plot.scaling=-1,
#         factors=factors, mode="cca", biplot.sig=0.1,
#         taxa=20, biplot.scale=3, cex.point=3,
#         plot.species=TRUE, rank="g")
# ## End(Not run)

Run the code above in your browser using DataLab