My previous PR seemed to have included a bug when using trees with node labels and doing ace for discrete data (guessing from here).
Here's a quick fix and the test for discrete characters for next release.
test_that("adding node labels to ace output works for discrete characters", {
## Example with no node labels
data(bird.orders)
x <- as.factor(c(rep(0, 5), rep(1, 18)))
### Compare the three methods for continuous characters:
out <- ace(x, bird.orders, type = "d")
expect_equal(rownames(out$lik.anc), as.character(seq(from = 1+Ntip(bird.orders), to = Nnode(bird.orders)+Ntip(bird.orders))))
## Adding node labels
phy_nodes <- makeNodeLabel(bird.orders)
out <- ace(x, phy_nodes, type = "d")
expect_equal(rownames(out$lik.anc), phy_nodes$node.label)
})
My previous PR seemed to have included a bug when using trees with node labels and doing ace for discrete data (guessing from here).
Here's a quick fix and the test for discrete characters for next release.