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.
avgdist.squared(
otu.table,
dist.method = "jaccard",
tree = NULL,
scale.otu.table = FALSE,
n.rarefy = 100,
binary = TRUE,
seed = 123
)a single matrix object
The average of the squared distance matrices.
the n.obs by n.otu matrix of read counts.
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.
the phylogeneic tree. The default is NULL.
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.
number of rarefactions. The default is 100.
the "binary" parameter in vegdist. The default is TRUE.
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.
Yi-Juan Hu <yijuan.hu@emory.edu>, Glen A. Satten <gsatten@emory.edu>
dist.avg.D2 <- avgdist.squared(throat.otu.tab5, dist.method="jaccard", n.rarefy=100)
Run the code above in your browser using DataLab