File: test-2-hclust.R

package info (click to toggle)
r-cran-ggdendro 0.1.22%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 368 kB
  • sloc: sh: 13; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11

test_that("data_hclust() returns the correct classes", {
  hc <- hclust(dist(USArrests), "ave")

  expect_s3_class(dendro_data(hc, type = "rectangle"), "dendro")

  ddata <- dendro_data(hc, type = "rectangle")
  expect_s3_class(segment(ddata), "data.frame")
  expect_s3_class(label(ddata), "data.frame")
  expect_equal(nrow(segment(ddata)), 196)
})