Learn R Programming

ecodist (version 1.1.0)

pco: Principal coordinates analysis

Description

Principal coordinates analysis (classical scaling).

Usage

pco(x, negvals = "zero", dround = 0)

Arguments

x
a lower-triangular dissimilarity matrix.
negvals
if = "zero" sets all negative eigenvalues to zero; if = "rm" corrects for negative eigenvalues using method 1 of Legendre and Anderson 1999.
dround
if greater than 0, attempts to correct for round-off error by rounding to that number of places.

Value

  • valueseigenvalue for each component. This is a measure of the variance explained by each dimension.
  • vectorseigenvectors. Each column contains the scores for that dimension.

Details

PCO (classical scaling, metric multidimensional scaling) is very similar to principal components analysis, but allows the use of any dissimilarity metric.

See Also

princomp, nmds

Examples

Run this code
data(iris)
iris.md <- distance(iris[,1:4], "mahal")
iris.pco <- pco(iris.md)

# scatterplot of the first two dimensions
plot(iris.pco$vectors[,1], iris.pco$vectors[,2], pch=as.numeric(iris[,5]))

# A full example is available in the PCO 
# section of the main help file for \link{ecodist}.

Run the code above in your browser using DataLab