mrca.age=function(tree)
{
return(coalescent.intervals(tree)$total.depth)
}
filename=system.file("Examples/example_g_pars", package="Rsampletrees")
runpars=readArgs(filename, check=FALSE)
# Must change the path so that the output can be found
runname=paste(system.file(package="Rsampletrees"),runpars$RunName, sep="/")
runpars=changeArgs(runpars, RunName=runname)
# Read in the output
results=readOutput(argob=runpars, addtrees=TRUE)
test=treeapply(results, myfunc=mrca.age,funcname="TimeMRCA")
results=readOutput(argob=runpars)
test=treeapply(results, myfunc=mrca.age, treerange=50:60)
Run the code above in your browser using DataLab