tests/testthat/test_corrected_plot.R

context("Check that the corrected plots have increasing heights")

test_that("'adjClust' returns a dendrogram with increasing heights for 
          'mode=corrected'", {
  data("iris")
  dissim <- dist(iris[ ,1:4])^2
  sim <- 1-as.matrix(dissim)/2
  fit <- adjClust(sim)
  corrected_dendo <- as.hclust(plot(fit, mode = "corrected"))
  expect_equal(sum(diff(corrected_dendo$height) < 0), 0)
})

Try the adjclust package in your browser

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

adjclust documentation built on April 28, 2023, 1:10 a.m.