get.rtt.dist <-
function(phylo){
di.phylo <- dist.nodes(phylo)
root.phylo <- phylo$edge[, 1][!(phylo$edge[, 1] %in% phylo$edge[, 2])][1]
phylo.depth <- max(di.phylo[as.numeric(colnames(di.phylo)) == root.phylo, ])
node.times <- phylo.depth - di.phylo[as.numeric(rownames(di.phylo)) == root.phylo, ]
tip.times <- phylo.depth - di.phylo[as.numeric(rownames(di.phylo)) == root.phylo, 1:length(phylo$tip.label)]
tip.times <- abs(tip.times - max(node.times))
return(tip.times)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.