dist function

Distance Matrix Computation (including Aitchison distance)

Distance Matrix Computation (including Aitchison distance)

This function overwrites dist function to contain Aitchison distance between compositions.

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

Arguments

  • x: compositions method
  • method: the distance measure to be used. This must be one of "aitchison", "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given.
  • ...: arguments passed to dist function

Returns

dist returns an object of class "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') # method = 'euclidean' # using Aitchison distance, only relative information is of importance dist(rbind(c(1,1,1), c(100, 100, 100)), method = 'ait') # method = 'aitchison'

See Also

See functions dist.

  • Maintainer: Marc Comas-Cufí
  • License: GPL
  • Last published: 2023-11-25