Learn R Programming

ade4 (version 1.7-22)

quasieuclid: Transformation of a distance matrice to a Euclidean one

Description

transforms a distance matrix in a Euclidean one.

Usage

quasieuclid(distmat)

Value

object of class dist containing a Euclidean distance matrice

Arguments

distmat

an object of class dist

Author

Daniel Chessel
Stéphane Dray stephane.dray@univ-lyon1.fr

Details

The function creates a distance matrice with the positive eigenvalues of the Euclidean representation.
Only for Euclidean distances which are not Euclidean for numeric approximations (for examples, in papers as the following example).

Examples

Run this code
data(yanomama)
geo <- as.dist(yanomama$geo)
is.euclid(geo) # FALSE
geo1 <- quasieuclid(geo)
is.euclid(geo1) # TRUE
par(mfrow = c(2,2))
lapply(yanomama, function(x) plot(as.dist(x), quasieuclid(as.dist(x))))

par(mfrow = c(1,1))

Run the code above in your browser using DataLab