Learn R Programming

phyclust (version 0.1-9)

rescale.rooted.tree: Rescale a rooted tree's height

Description

This function rescaled the input rooted tree height by a scale.height.

Usage

rescale.rooted.tree(rooted.tree, scale.height = 1)

Arguments

rooted.tree
a rooted tree in Class phylo.
scale.height
a scale to all branch lengths.

Value

  • Return a rooted tree in Class phylo with scaled branches.

Details

The rooted.tree should be in a phylo class of ape, and may be created by ms.

scale.height is a positive number multiplying on the lengths of all branches of the rooted tree.

References

Phylogenetic Clustering Website: http://thirteen-01.stat.iastate.edu/snoweye/phyclust/

See Also

ms, read.tree, as.phylo, get.rooted.tree.height.

Examples

Run this code
set.seed(1234)
ret.ms <- ms(5, 1, opts = paste("-T", sep = " "))
tree.ms <- read.tree(text = ret.ms[3])
get.rooted.tree.height(tree.ms)

tree.scaled <- rescale.rooted.tree(tree.ms, scale.height = 2)
get.rooted.tree.height(tree.scaled)

Run the code above in your browser using DataLab