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

Description Usage Arguments Value Author(s) Examples

View source: R/addroot.R

Description

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

Usage

1
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

1
2
3
4
5
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)

TreePar documentation built on May 1, 2019, 9:20 p.m.