intnode.times <-
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, (length(phylo$tip.label) + 1):nrow(di.phylo)]
return(node.times)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.