quasieuclid {ade4}R Documentation

Transformation of a distance matrice to a Euclidean one

Description

transforms a distance matrix in a Euclidean one.

Usage

quasieuclid(distmat)

Arguments

distmat an object of class dist

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).

Value

object of class dist containing a Euclidean distance matrice

Author(s)

Daniel Chessel
St├ęphane Dray dray@biomserv.univ-lyon1.fr

Examples

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))

Worked out examples


> library(ade4)
> ### Name: quasieuclid
> ### Title: Transformation of a distance matrice to a Euclidean one
> ### Aliases: quasieuclid
> ### Keywords: array
> 
> ### ** Examples
> 
> data(yanomama)
> geo <- as.dist(yanomama$geo)
> is.euclid(geo) # FALSE
[1] FALSE
> geo1 <- quasieuclid(geo)
> is.euclid(geo1) # TRUE
[1] TRUE
> par(mfrow = c(2,2))
> lapply(yanomama, function(x) plot(as.dist(x), quasieuclid(as.dist(x))))
$geo
NULL

$gen
NULL

$ant
NULL

> 
> par(mfrow = c(1,1))
> 
> 
> 

[Package ade4 Index]