dist: Distance Matrix Computation (including Aitchison distance)

View source: R/utils.R

distR Documentation

Distance Matrix Computation (including Aitchison distance)

Description

Compute a distance matrix for compositional data, including the Aitchison distance as an extension of dist.

Usage

dist(x, method = "euclidean", ...)

Arguments

x

A data matrix whose rows are compositions.

method

The distance measure to be used. This must be one of "aitchison", "euclidean", "maximum", "manhattan", "canberra", "binary", or "minkowski". Any unambiguous abbreviation can be given.

...

Additional arguments passed to dist.

Value

An object of class "dist".

See Also

dist

Examples

X <- exp(matrix(rnorm(10 * 50), ncol = 50, nrow = 10))

(d <- dist(X, method = "aitchison"))
plot(hclust(d))

# In contrast to Euclidean distance
dist(rbind(c(1, 1, 1), c(100, 100, 100)), method = "euc")

# Using Aitchison distance, only relative information is of importance
dist(rbind(c(1, 1, 1), c(100, 100, 100)), method = "ait")


coda.base documentation built on March 4, 2026, 9:06 a.m.