Learn R Programming

phytools (version 0.2-40)

paste.tree: Paste two trees together

Description

Primarily internal function for posterior.evolrate; can be used to graft a clade into a receptor tree, at the "sticky tip" labeled with "NA".

Usage

paste.tree(tr1, tr2)

Arguments

tr1
receptor tree.
tr2
donor clade.

Value

  • a tree.

Details

For this to work, the donor clade needs to have a root edge, even if it is zero length.

Examples

Run this code
tr1<-rtree(10)
  tr2<-rtree(10)
  tr1$tip.label[1]<-"NA"
  tr2$root.edge<-0
  tr3<-paste.tree(tr1,tr2)

Run the code above in your browser using DataLab