tests/testthat/test-mds_rho.R

library(AnthropMMD)

## Import dataset and transform it to a table of frequencies:
data(toyMMD)
tab <- binary_to_table(toyMMD, relative = TRUE)
## Compute MMD results with AnthropMMD:
mmd.ans <- mmd(tab, angular = "Anscombe")
## Compute classical (metric) MDS:
coor_mmds <- cmdscale(mmd.ans$MMDSym)

test_that("mds_rho gives correct answer", {
  expect_equal(mds_rho(mmd = mmd.ans$MMDSym, coor = coor_mmds), 0.988)
})

Try the AnthropMMD package in your browser

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

AnthropMMD documentation built on Aug. 8, 2023, 5:12 p.m.