inst/tinytest/test-balance.r

set.seed(21512)
x <- raphylo(20)

x$tip.annotation[] <- rep(c(0,1), 10)
expect_equal(balance_ann(x), 1)

x$tip.annotation[] <- rep(0, 20)
expect_equal(balance_ann(x), 0)

x$tip.annotation[] <- rep(1, 20)
expect_equal(balance_ann(x), 0)

expect_error(balance_ann(x$tree))

Try the aphylo package in your browser

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

aphylo documentation built on April 4, 2025, 2:18 a.m.