R/PCoA.R

Defines functions `PCoA`

`PCoA` <-
    function(D)
{
    M <- as.matrix(D^2)
    M <- scale(M, center = TRUE, scale = FALSE)
    M <- t(scale(t(M), center = TRUE, scale = FALSE))
    SOL <- eigen(-M/2, symmetric = TRUE)
    nonzero <- abs(SOL$values) > sqrt(.Machine$double.eps)
    SOL$values <- SOL$values[nonzero]
    SOL$vectors <- SOL$vectors[, nonzero]
    SOL
}

Try the barebone package in your browser

Any scripts or data that you put into this service are public.

barebone documentation built on May 2, 2019, 5:17 p.m.