inst/tinytest/test_hash.R

trees <- rmtree(30, 5, rooted=FALSE)
trees <- .compressTipLabel(trees, ref=sort(trees$tip.label))

tree_u1 <- unique(trees)
tmp <- sapply(trees, phangorn:::hash_phylo)
tree_u2 <- trees[!duplicated(tmp)]

expect_equal(attr(tree_u1, "old.index"), match(tmp, tmp))


#all.equal
# RF.dist  && dist.topo

Try the phangorn package in your browser

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

phangorn documentation built on Jan. 23, 2023, 5:37 p.m.