Learn R Programming

RAM (version 1.2.0)

group.indicators: Plot Indicator Taxon Groups for Metadata Trends

Description

This function conumes one or two OTU tables, along with a metadata facotr, and creates a barplot showing the relative abundance of all groups which are statistical indicators of that factor.

Usage

group.indicators(data, is.OTU=TRUE, meta, factor, rank,
                thresholds = c(A = 0.85, 
                               B = 0.8, 
                               stat = 0.8, 
                               p.value = 0.05),  
                 all.indicators=TRUE, cex.x=NULL, file = NULL, 
                 ext = NULL, height = 12, width = 12)

Arguments

data
a list of OTUs or taxonomic abundance matrices. see also RAM.input.formatting
is.OTU
logical. Whether the input data are OTU tables.
meta
the metadata table to be used.
factor
a named character vector (of length 1) giving the name of the column in meta to be used when performing the analysis (see RAM.factors).
rank
the taxonomic rank to use (see ?RAM.rank.formatting for formatting details). if rank is NULL, will use otus as indicators which are annotated by the lca assigned to the otus, otherwise will use taxon names as indicators at the g
thresholds
a character vector of length 4 specifying the thresholds for the A, B, stat, and p values (see Details).
all.indicators
logical. Whether or not plot all identified indicators. If set as TRUE, will plot all indicators, otherwise, if the total indicators are less than 12, will plot them all; if the total indicators are more than 12, will plot the first 12 of t
cex.x
optional. The size of x axis names.
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

  • This function returns a stacked barplot and a vector of identified indicators, including the ones in the plot and the ones being excluded from the plot.

Details

This function uses indicspecies::multipatt to determine the indicators. After this analysis is performed, there will likely be some species determined to be 'significant,' but to varying degrees. To control how many groups are selected, you can adjust the thresholds argument. It consists of four components: (quotations taken from vignette("indicspeciesTutorial"), see References):

[object Object],[object Object],[object Object],[object Object]

Only the species with A, B, and stat values above, and p.value below those given in thresholds will be kept.

References

De Caceres, M., Legendre, P. (2009). Associations between species and groups of sites: indices and statistical inference. Ecology, URL http://sites.google.com/site/miqueldecaceres/

See Also

multipatt

Examples

Run this code
data(ITS1, ITS2, meta)
# inputs are OTU tables
group.indicators(data=list(ITS1=ITS1, ITS2=ITS2), is.OTU=TRUE, meta, 
                     factor = c(Province="Province"), 
                     rank="g")
group.indicators(data=list(ITS1=ITS1), is.OTU=TRUE, meta, 
                     factor = c(Province="Province"), 
                     rank=NULL, all.indicators=TRUE)
group.indicators(data=list(ITS1=ITS1), is.OTU=TRUE, meta, 
                     factor = c(Province="Province"), 
                     rank=NULL, all.indicators=FALSE)
# inputs are taxonomic abundance matrices
g1 <- tax.abund(ITS1, rank="g")
g2 <- tax.abund(ITS2, rank="g")
group.indicators(data=list(g1=g1, g2=g2), is.OTU=FALSE, meta, 
                     factor = c(Province="Province"), 
                     rank="g")

Run the code above in your browser using DataLab