inst/tinytest/test_dist.R

data("hongite")
coda <- as_composition(hongite)

# Aitchison distance ===========================================================
expect_equal_to_reference(
  dist(coda, method = "euclidean", diag = TRUE, upper = TRUE),
  file = "_snaps/dist_euclidean.rds"
)

# Mahalanobis distance =========================================================
expect_equal_to_reference(
  mahalanobis(coda, robust = FALSE),
  file = "_snaps/dist_mahalanobis.rds"
)

Try the nexus package in your browser

Any scripts or data that you put into this service are public.

nexus documentation built on Sept. 11, 2024, 6:43 p.m.