group.OTU: Plot Distribution of OTUs

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

Description

This function plot the distributon of otus in each level of a given metadata variable. The plot can be boxplot of barplot. The boxplot shows the range of relative abundance of a given otuID in each level of metadata category. The barplot shows the relative abundance of the total counts of a given otuID in each level of metadata category.

Usage

1
2
3
group.OTU(otu, rank="g", otuIDs="", meta, meta.factor="",
         boxplot=TRUE, main="", file=NULL, ext=NULL,
         height=8, width=16)

Arguments

otu

the OTU table to be analyzed.

rank

optional. if NULL, the lca of the OTUs will be retrieved; otherwise, the user should provide a valid taxonomic rank that an otu being classified to (see ?RAM.rank.formatting for formatting details).

otuIDs

an vector of otuIDs in the OTU table

meta

the metadata table to be analyzed.

meta.factor

the metadata qualitative variable

boxplot

logical. If TRUE, generate boxplot; otherwise generate barplot.

main

title of the plot.

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".

height

the height of the image to be created (in inches).

width

the width of the image to be created (in inches).

Value

group.OTU returns boxplot or barplot for the distribution of a list of otuIDs.

Note

The OTUs are determined to be absent/present using the "pa" method from the function decostand.

Author(s)

Wen Chen

See Also

ggplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(ITS1, meta)
# otuIDs
otuIDs=rownames(ITS1)[1:10]
# names(meta)
theme <- RAM.color()
group.OTU(otu=ITS1, rank="g", otuIDs=otuIDs,
        meta=meta, meta.factor="City", boxplot=TRUE,
        file=NULL, ext=NULL) + theme
## Not run: 
group.OTU(otu=ITS1, rank="g", otuIDs=otuIDs,
               meta=meta, meta.factor="City", boxplot=FALSE,
               file=NULL) + theme

## 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
Warning messages:
1: `axis.ticks.margin` is deprecated. Please set `margin` property  of `axis.text` instead 
2: `panel.margin` is deprecated. Please use `panel.spacing` property instead 
Using City, Sample as id variables
Using City, Sample as id variables
Using City, Sample as id variables
Using City as id variables

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