data(agamids)
write.table(agamids, file = 'example.tre', quote=FALSE,
row.names = FALSE, col.names = FALSE)
# the preceding lines generate a file 'example.tre' that can be
# read by 'getBtimes'
agbtimes <- getBtimes(file = 'example.tre')
#or alternatively:
agbtimes <- getBtimes(string = agamids)
#agbtimes is now a numeric vector of branching times
plotLtt(agbtimes) #plot log-lineages through time for agamid data
gamStat(agbtimes) #calculate gamma statistic for agamid data
unlink('example.tre') #clean-up.
Run the code above in your browser using DataLab