tests/testthat/test-as.matrix.R

test_that("as.matrix(phylo)", {
  bal8 <- BalancedTree(8)
  sp8 <- as.Splits(bal8)
  expect_equal(as.matrix(bal8), 1 * as.logical(sp8))
  expect_equal(TipLabels(as.matrix(bal8)), TipLabels(bal8))
  expect_equal(as.logical(bal8), as.logical(sp8))
})

Try the TreeTools package in your browser

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

TreeTools documentation built on April 23, 2026, 5:06 p.m.