# Load a dataset and a tree
data(data1)
data(sim.tree1)
# Find the node.ages and add as a column to the dataset
data1$age = pair.age.in.tree(dataset=data1, tree=sim.tree1, taxacolumns=c("sp1","sp2"))
head(data1)
# Plot tree with axis in units of branch lengths and perform visual check that dates are correct
# \donttest{
library(ape)
plot(sim.tree1)
axisPhylo()
# }
# Load a dataset and a tree
data(data1)
data(sim.tree1)
# Find the node.ages and add as a column to the dataset
data1$age = pair.age.in.tree(dataset=data1, tree=sim.tree1, taxacolumns=c("sp1","sp2"))
head(data1)
# \donttest{
# Plot tree with axis in units of branch lengths and perform visual check that dates are correct
library(ape)
plot(sim.tree1)
axisPhylo()
# }
Run the code above in your browser using DataLab