mrca.age=function(tree)
{
return(coalescent.intervals(tree)$total.depth)
}
filename=system.file("Examples/example_h_pars",package="Rsampletrees")
runpars=readArgs(filename, check=FALSE)
runname=paste(system.file(package="Rsampletrees"),runpars$RunName, sep="/")
runpars=changeArgs(runpars, RunName=runname)
results=readOutput(runpars)
results=addTreeStat(results, myfunc=mrca.age)
writeTreeoutput(results, ask=FALSE)
Run the code above in your browser using DataLab