View source: R/branch_lengths.R
rescale_deepest_branches | R Documentation |
Sets lengths of branches immediately below the root to the same, user-specified length.
rescale_deepest_branches(phy, length = 1)
phy |
A phylo object, the tree to manipulate. |
length |
A numeric stating the branch length. |
A phylo object, the manipulated tree.
library(ape)
arnhem_hypothesis <-
c("Gunwinyguan", "Mangarrayi-Maran", "Maningrida",
"Kungarakany", "Gaagudju")
tree <- assemble_rake(abridge_labels(get_glottolog_trees(arnhem_hypothesis)))
plot_glotto(tree)
# tree now contains five language families. All branch lengths are 1.
# Set the deepest branch lengths to 5, implying a great genealogical
# distance between the families within the tree.
tree2 <- rescale_deepest_branches(tree, length = 5)
plot_glotto(tree2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.