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

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

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

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

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.

Author(s)

Wen Chen.

See Also

decostand, Taxa.ord, pcoa.plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

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  0  columns are removed:  "
[1] "columns in exclude list: "
[1] "column# with missing data: "
[1] "columns# with one level: "
[1] "column# that are not numeric or factor: "
[1] "A total of  0  columns are removed:  "
[1] "columns in exclude list: "
[1] "column# with missing data: "
[1] "columns# with one level: "
[1] "column# that are not numeric or factor: "
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.
Warning: Ignoring unknown parameters: inherit_aes
Warning messages:
1: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
3: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
4: In OTU.ord(its1, meta = meta, data.trans = "total", factors = factors,  :
  na.action was not properly selected, will used default 'na.fail'
[1] "A total of  0  columns are removed:  "
[1] "columns in exclude list: "
[1] "column# with missing data: "
[1] "columns# with one level: "
[1] "column# that are not numeric or factor: "
[1] "A total of  0  columns are removed:  "
[1] "columns in exclude list: "
[1] "column# with missing data: "
[1] "columns# with one level: "
[1] "column# that are not numeric or factor: "
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.
Warning: Ignoring unknown parameters: inherit_aes
Warning messages:
1: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
2: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
3: In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
4: In OTU.ord(its1, meta = meta, data.trans = "total", plot.scaling = -1,  :
  na.action was not properly selected, will used default 'na.fail'

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