dist_coda: Distance Matrix Computation for CoDa distances

View source: R/utils.R

dist_codaR Documentation

Distance Matrix Computation for CoDa distances

Description

Compute a distance matrix for compositional data using selected CoDa distances.

Usage

dist_coda(x, method = "aitchison", ...)

Arguments

x

A data matrix whose rows are compositions.

method

The distance measure to be used. This must be one of "aitchison", "L1", "L1-pw", or "L1-clr". Any unambiguous abbreviation can be given.

...

Additional arguments. diag and upper are passed to as.dist for L1 distances and all arguments are passed to dist for the Aitchison distance.

Value

An object of class "dist".

References

Saperas-Riera, J.; Mateu-Figueras, G.; Martín-Fernández, J.A. (2024). Lp-Norm for Compositional Data: Exploring the CoDa L1-Norm in Penalised Regression. Mathematics, 12(9), 1388. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3390/math12091388")}.

See Also

dist, dist

Examples

set.seed(1)
X <- exp(matrix(rnorm(10 * 5), ncol = 5, nrow = 10))

dist_coda(X, method = "aitchison")
dist_coda(X, method = "L1")
dist_coda(X, method = "L1-pw")
dist_coda(X, method = "L1-clr")


coda.base documentation built on May 8, 2026, 5:10 p.m.