Learn R Programming

LDM (version 6.0.1)

avgdist.squared: Averaging the squared distance matrices each calculated from a rarefied OTU table

Description

This function computes a distance matrix for each rarefied OTU table, square the distance matrix (in an element-wise manner), and then average the squared distance matrices.

Usage

avgdist.squared(
  otu.table,
  dist.method = "jaccard",
  tree = NULL,
  scale.otu.table = FALSE,
  n.rarefy = 100,
  binary = TRUE,
  seed = 123
)

Value

a single matrix object

D2.avg

The average of the squared distance matrices.

Arguments

otu.table

the n.obs by n.otu matrix of read counts.

dist.method

method for calculating the distance measure, partial match to all methods supported by vegdist in the vegan package. The default is "jaccard". For more details, see the dist.method argument in the ldm function.

tree

the phylogeneic tree. The default is NULL.

scale.otu.table

a logical variable indicating whether to scale the rows of the OTU table. For count data, this corresponds to dividing by the library size to give relative frequencies. The default is FALSE.

n.rarefy

number of rarefactions. The default is 100.

binary

the "binary" parameter in vegdist. The default is TRUE.

seed

a single-value integer seed for the random process of drawing rarefaction replicates. The seed is user supplied or internally generated. The default is 123.

Author

Yi-Juan Hu <yijuan.hu@emory.edu>, Glen A. Satten <gsatten@emory.edu>

Examples

Run this code
dist.avg.D2 <- avgdist.squared(throat.otu.tab5, dist.method="jaccard", n.rarefy=100)

Run the code above in your browser using DataLab