par(mfrow = c(1,3))
tree = sim.tree(5, 100)
tree$tip.label = c("Sp1", "Sp2", "Sp3", "Sp4", "Sp5")
plot(tree)
ape::edgelabels(round(tree$edge.length, 3))
newTree = tree.addTip(tree, c("Sp1"), "Sp6", 0.1)
plot(newTree)
ape::edgelabels(round(newTree$edge.length, 3))
newTree = tree.addTip(tree, c("Sp1", "Sp2"), "Sp7", 0.2, 0.01)
plot(newTree)
ape::edgelabels(round(newTree$edge.length, 3))
Run the code above in your browser using DataLab