tree <- BalancedTree(8, lengths = c(rep(2, 4), 5:7, rep(2, 4), rep(1, 3)))
lb <- LongBranch(tree)
tree$tip.label <- paste(tree$tip.label, signif(lb, 3), sep = ": ")
plot(tree, tip.col = SupportColour((1 - lb) / 2), font = 2)
# Standard deviation of LB scores allows comparison with other trees
sd(lb)
evenLengths <- BalancedTree(8, lengths = jitter(rep(1, 14)))
sd(LongBranch(evenLengths))
# Upper quartile identifies taxa with longest branches
threshold <- quantile(lb, 0.75)
tree$tip.label[lb > threshold]
Run the code above in your browser using DataLab