Learn R Programming

RAM (version 1.2.1.3)

Taxa.ord: Ordination Plot For Taxa Groups Using CCA or RDA Analysis

Description

This function consumes an ecology data set, metadata factors, and graphing options, then produces a plot showing the vegan::cca or vegan::rda analysis.

Usage

Taxa.ord(data, is.OTU=TRUE, meta=meta, factors=NULL, group=NULL, rank="g", taxa=10, 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.label=1, cex.leg=12, cex.bp=3, cex.text=3, file=NULL, ext=NULL, width=10, height=10)

Arguments

data
an ecology data set, either an otu table or a taxonomy abundance matrix.
is.OTU
whether or not the data an otu table
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).
rank
the rank to select the taxon groups at.
taxa
an integer or a character vector of taxa names at the given rank. if integer, plot the top most abundant taxa, otherwise plot the taxa in the vector.
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 codeplot.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, ordination model calcuated 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.label
size of taxa lables
cex.leg
size of lengend name
cex.text
size of taxon names if plot.species is set TRUE
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, OTU.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: 
# ord <- Taxa.ord(its1,  meta=meta, data.trans="total",
#         factors=factors, mode="cca", biplot.sig=0.1,
#         taxa=20, biplot.scale=1.5, cex.point=5, cex.label=1,
#         plot.species=TRUE, rank="g", plot.scaling=3,
#         group=c(City="City", Crop="Crop"), biplot.label=FALSE)
# names(ord)
# ## End(Not run)

Run the code above in your browser using DataLab