do_PCoA: Perform PCoA on a distance matrix

Description Usage Arguments See Also

View source: R/do_PCoA.R

Description

This is a convenience wrapper for the <e2><80><98>cmdscale<e2><80><99> function from the vegan package. It takes a distance matrix (an object of type "dist") and performs a PCoA ordination with <e2><80><98>cmdscale<e2><80><99>, for two dimensions (k = 2). Returns a list containing <e2><80><98>Coordinates<e2><80><99>, a tbl with the PCoA coordinates; and <e2><80><98>Variance1<e2><80><99> and <e2><80><98>Variance2<e2><80><99>, the percentage variance explained by the first and second PCoA axes respectively.

The method for calculating variance explained comes from http://r-sig-ecology.471788.n2.nabble.com/Variability-explanations-for-the-PCO-axes-as-in-Anderson-and-Willis-2003-td6429547.html.

Usage

1
do_PCoA(DistanceMatrix)

Arguments

DistanceMatrix

a dist object containing the distances between samples

See Also

dist for info on the dist object

read_dist to read a distance matrix from a file (e.g. reading in UniFrac distances)

cmdscale the vegan function that performs the actual ordination


wilkox/doPCoA documentation built on May 4, 2019, 5:25 a.m.