tree <- treeDbalance::example3Dtrees$bean21
# Visualize enumeration: plotPhylo3D(tree, show_node_enum = TRUE)
tree_depthwise <- enum2depthwise(tree)
# Visualize: addPhylo3D(tree_depthwise, offset=c(2,0,0), show_node_enum = TRUE)
tree_cladewise <- enum2cladewise(tree)
# Visualize: addPhylo3D(tree_cladewise, offset=c(4,0,0), show_node_enum = TRUE)
bad_tree <- list(
edge = matrix(c(1, 13, 1, -7, 13, 4), byrow = TRUE, ncol = 2),
tip.label = c("", ""), Nnode = 2
)
better_tree <- enum2_1toV(bad_tree)
better_tree$edge
bad_3Dtree <- list(
edge = matrix(c(1, 2, 1, 5, 2, 4), byrow = TRUE, ncol = 2),
tip.label = c("", ""), Nnode = 2,
node.coord = matrix(c(
1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4,
5, 5, 5, 6, 6, 6
), byrow = TRUE, ncol = 3),
edge.weight = c(1, 1, 1)
)
better_3Dtree <- enum2_1toV(bad_3Dtree)
better_3Dtree$edge
better_3Dtree$node.coord
Run the code above in your browser using DataLab