shiftNodeAge: Modify Node Ages in Ultramtric Trees

Description Usage Arguments Value Author(s) See Also Examples

Description

The functions is intended to manually change the height of internal nodes (i.e. changing the 'age of nodes'), e.g. to create a tree prior for Bayesian phylogeny estimation (BEAST, etc.).

Usage

1
shiftNodeAge(phy, node, shift = NULL, age = NULL)

Arguments

phy

An object of class "phylo". Must be ultrametric (see is.ultrametric)

node

An integer, the number of the internal node whose age is to be modified.

shift

A real number giving the age shift of node in the same units as the branch lengths od phy. Positive numbers shift the node back in time; negative numbers render it younger. shift is overridden by age.

age

A real number giving the new age of node in the same units as the branch lengths of phy. Overrides shift.

Value

An object of class "phylo"

Author(s)

Christoph Heibl

See Also

rbeauti, compare.phylo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Phylogeny of bird orders:
data(bird.orders)

# Have a look at the phylogeny:
plot(bird.orders)
axisPhylo()

# Change age of node 42 ...
tr <- shiftNodeAge(bird.orders, 42, -15)

# ... plot again:
plot(tr)
axisPhylo()

# Alternatively, the result can be checked with 'compare.phylo':
compare.phylo(bird.orders, tr)

# Note that time shifts must not exceed the available 
# branch length:
#tr <- shiftNodeAge(bird.orders, 42, +15)

fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.