View source: R/branch_lengths.R
| rescale_branches_constrained | R Documentation | 
Sets the branches furthest from the root to shortest_length and then
scales other branches exponentially in such a way that the total tree has a
height of tree_height.
rescale_branches_constrained(phy, tree_height, shortest_length)
| phy | A phylo object, the tree to manipulate. | 
| tree_height | A positive numeric, the desired height of the whole tree. | 
| shortest_length | A positive numeric, the desired length of the shortest branches, i.e., the branches farthest from the root. | 
A phylo object, the manipulated tree.
library(ape)
tree <- abridge_labels(get_glottolog_trees("Siouan"))
plot_glotto(tree)
tree2 <- rescale_branches_constrained(tree, tree_height = 2000, shortest_length = 200)
plot_glotto(tree2)
tree3 <- rescale_branches_constrained(tree, tree_height = 2000, shortest_length = 100)
plot_glotto(tree3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.