Learn R Programming

ProcMod (version 1.0.8)

is_euclid: Test if the distance matrix is euclidean.

Description

Actually a simplified version of the ADE4 implementation (is.euclid).

Usage

is_euclid(distances, tol = 1e-07)

Arguments

distances

an object of class 'dist'

tol

a tolerance threshold : an eigenvalue is considered positive if it is larger than -tol*lambda1 where lambda1 is the largest eigenvalue.

Examples

Run this code
# NOT RUN {
library(vegan)
data(bacteria)

bacteria_rel_freq <- sweep(bacteria,
                           1,
                           rowSums(bacteria),
                           "/")

bacteria_bray <- vegdist(bacteria_rel_freq,method = "bray")
is_euclid(bacteria_bray)

bacteria_chao <- vegdist(floor(bacteria*10000),method = "chao")
is_euclid(bacteria_chao)

# }

Run the code above in your browser using DataLab