R/intnode.times.R

Defines functions intnode.times

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)
}
sebastianduchene/NELSI documentation built on Aug. 18, 2022, 11:45 p.m.