pcoa: Principal Coordinates Analysis

View source: R/pcoa.R

pcoaR Documentation

Principal Coordinates Analysis

Description

Performs principal coordinates analysis (PCoA) on a distance matrix generated by the dist() function. This function reads the distance matrix and item names from the DIST output files and creates a PCoA scatterplot.

Usage

pcoa(notu)

Arguments

notu

Number of operational taxonomic units (items) in the dataset.

Value

Invisibly returns a list with the following components:

points

A two-column matrix of the coordinates of the items on the first two principal coordinate axes.

eig

The eigenvalues of the PCoA solution, as returned by cmdscale.

variance

A numeric vector of length 2 giving the proportion of total variance explained by Axis 1 and Axis 2 (values between 0 and 1).

cumulative

A single numeric value giving the cumulative proportion of variance explained by the first two axes combined.

cmdscale

The full result object returned by cmdscale, for users who need access to all components.

Examples

# Requires the CONFOR and DIST executables on the PATH.

try({
  delta <- load_delta(
    system.file("extdata", "chars_viola", package = "RDelta"),
    system.file("extdata", "items_viola", package = "RDelta"),
    system.file("extdata", "specs_viola", package = "RDelta")
  )
  dist(delta)
  res <- pcoa(delta$get_items_nb())
  res$variance
  res$cumulative
})


RDelta documentation built on Oct. 28, 2026, 5:12 p.m.