reGravitise: Change gravity of tree

Description Usage Arguments Details References Examples

Description

Return a tree with gravity changed by factor.

Usage

1

Arguments

tree

phylogenetic tree (ape class)

factor

proportion (-1 to +1) by which gravity is changed, positive values increase gravity, negative values decrease it.

Details

The functions works by adding and removing branch length between parent and child branches. The amount by which the branch lengths are changed is determined by factor.

References

No references yet! https://github.com/DomBennett/MoreTreeTools.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create balanced tree, plot positively and negatively reGravitised
n <- 16
par (mfrow = c (3, 1), mar = c (1, 1, 1, 1))
tree <- compute.brlen (stree (n, 'balanced'))
tree$root.edge <- 0.1  # add a root edge
plot (tree, show.tip.label=FALSE, edge.width=2, root.edge=TRUE,
      main='Original')
plot (reGravitise (tree, factor = -0.9), show.tip.label=FALSE,
      edge.width=2, root.edge=TRUE, main='Reduced gravity')
plot (reGravitise (tree, factor = 0.9), show.tip.label=FALSE,
      edge.width=2, root.edge=TRUE, main='Increased gravity')

DomBennett/MoreTreeTools documentation built on May 6, 2019, 2:51 p.m.