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

Description Usage Arguments Details Value Note Author(s) See Also Examples

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

1
2
3
4
5
6
7
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).

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.

Value

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

Note

The labels for the taxa points are placed above, below, or next to the point itself at random. If labels are outside of the plotting area, or overlapping with each other, run your command again (without changing any arguments!) and the labels should move to new positions. Repeat until they are placed appropriately. This is done to ensure even tightly-grouped samples, or samples near the edge of the plot, have their labels shown. If the labels are too distracting, remember that they can be turned off by setting plot.species = FALSE.

Author(s)

Wen Chen.

See Also

decostand, OTU.ord, pcoa.plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-4
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
[1] "128 otus in ITS1 met the filter requirment."
[1] "A total of  1  columns are removed:  Harvestdate"
[1] "columns in exclude list: "
[1] "column# with missing data: "
[1] "columns# with one level: "
[1] "column# that are not numeric or factor: 6"
Scale for 'shape' is already present. Adding another scale for 'shape', which
will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
[1] "each number of biplot label represents: 1: CityCity2; 2: CropCrop2; 3: HarvestmethodMethod2; 4: Ergosterol_ppm"
Warning: Ignoring unknown parameters: inherit_aes
[1] "plot"      "ord_model" "dt"        "meta.new" 

RAM documentation built on May 2, 2019, 3:04 p.m.