rescale_deepest_branches: Set length of deepest branches

View source: R/branch_lengths.R

rescale_deepest_branchesR Documentation

Set length of deepest branches

Description

Sets lengths of branches immediately below the root to the same, user-specified length.

Usage

rescale_deepest_branches(phy, length = 1)

Arguments

phy

A phylo object, the tree to manipulate.

length

A numeric stating the branch length.

Value

A phylo object, the manipulated tree.

Examples


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)

erichround/glottoTrees documentation built on April 17, 2025, 10:47 a.m.