tests/testthat/test-rainbow_fun.R

# library(testthat)
# library(dendextend)


context("rainbow_fun")


test_that("rainbow_fun works", {
   
   dend <- as.dendrogram(hclust(dist(mtcars)))

   # if colorspace not installed
   expect_no_error(with_mock(
      requireNamespace = function(...) FALSE,
      rainbow_fun(1)
   ))
   
})

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.