tests/testthat/test-find_dend.R

# library(testthat)
# library(dendextend)


context("find_dend")


test_that("find_dend works", {
  
   x <- datasets::mtcars
   dist_x <- dist(x)
   
   best_dend <- find_dend(x, dist_methods = c("euclidean"))
   best_dist_dend <- find_dend(dist_x)
   
   # should be the same, as dist() resorts to euclidean by default
   expect_equal(
      best_dend,
      best_dist_dend
   )
   
})

Try the dendextend package in your browser

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

dendextend documentation built on April 4, 2025, 4:40 a.m.