Description Usage Arguments Value See Also Examples
Scale by a scalar factor all the edges ($edge.length) of a phylo object from the ape package, including the root edge ($root.edge) if present, and additive edges ($edge.length.add, present in trees returned by fit_tree()).
Stops if any of the edges exceed 1 before or after scaling (since these edges are IBD probabilities).
1 | scale_tree(tree, factor)
|
tree |
The coancestry tree to edit. |
factor |
The scalar factor to multiply all edges. Must be non-negative, and not be so large that any edge exceeds 1 after scaling. |
The edited tree with all edges scaled as desired.
ape::read.tree() for reading phylo objects and their definition.
1 2 3 4 5 6 7 | # create a random tree
library(ape)
k <- 5
tree <- rtree( k )
# scale this tree
tree_scaled <- scale_tree( tree, 0.5 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.