Last data update: 2014.03.03

R: addroot: Adds a root edge ancestral to the first branching...
addrootR Documentation

addroot: Adds a root edge ancestral to the first branching event.

Description

addroot adds a root edge ancestral to the first branching event.

Usage

addroot(tree,rootlength)

Arguments

tree

Tree of class phylo.

rootlength

Length of the root edge to be added.

Value

res

Tree of class phylo with root edge added to $edge and $edge.length (alternative is to store root edge in $root.edge as done in ape).

Author(s)

Tanja Stadler

Examples

set.seed(1)
# Simulate a tree
tree<-sim.bd.taxa(20,1,2,1,complete=FALSE,stochsampling=TRUE)
# add the root edge to the vector tree$edge and tree$edge.length
addroot(tree[[1]],tree[[1]]$root.edge)

Results