tests/testthat/test-conversion.R

context('as.polytomy')

test_that('collapse tree to polytomy', {
    file <- system.file("extdata/RAxML", "RAxML_bipartitions.H3", package="treeio")
    tree <- read.tree(file)
    cutoff <- 70
    tree2 <- as.polytomy(tree, 'node.label', function(x) as.numeric(x) < cutoff)
    expect_true(all(as.numeric(tree2$node.label) > 70, na.rm=T))
})

Try the ggtree package in your browser

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

ggtree documentation built on Nov. 15, 2020, 2:09 a.m.