rescale_branches: Set all branch length to 1

View source: R/branch_lengths.R

rescale_branchesR Documentation

Set all branch length to 1

Description

Sets all branch lengths in a tree to the same length.

Usage

rescale_branches(phy, length = 1)

Arguments

phy

A phylo object, the tree to manipulate.

length

A numeric stating the branch length.

Details

By default, sets all branch lengths to 1.

Value

A phylo object, the manipulated tree.

Examples


library(ape)
tree <- abridge_labels(get_glottolog_trees("Tangkic"))
tree2 <- clone_tip(tree, "nyan1300", n = 2, subgroup = TRUE)
plot_glotto(tree2)
tree3 <- rescale_branches(tree2)
plot_glotto(tree3)

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