set.seed(123)
## generate tree
tree<-pbtree(b=0.1, n=10)
## plot original tree
plot(tree)
axisPhylo()
## add an extant tip ("t_extant") sister to taxon 't5'
## with divergence time of 4.5 Ma
node <- which(tree$tip.label=="t5")
tree <- bind.tip(tree, tip.label="t_extant",
where=node, position=4.5)
# plot to see the result
plot(tree)
axisPhylo()
## add an extinct tip ("t_extinct") sister to 't2' with
## divergence time of 7.8 Ma and duration (edge length) of
## 3.3 Ma
node <- which(tree$tip.label=="t2")
tree <- bind.tip(tree, tip.label="t_extinct", where=node,
position=7.8, edge.length=3.3)
## plot to see the result
plot(tree)
axisPhylo()
Run the code above in your browser using DataLab