Re: [R-sig-phylo] Distances from nods to the root.

2014-05-21 Thread Emmanuel Paradis
Alexey, See ?dist.nodes in ape. If your tree is named tr, you'll get exactly what you want with: dist.nodes(tr)[, Ntip(tr) + 1] which extracts one column of the matrix returned by dist.nodes. best, Emmanuel Le 21/05/2014 06:56, Alexey Fomin a écrit : Which package allow calculate all

[R-sig-phylo] Distances from nods to the root.

2014-05-20 Thread Alexey Fomin
Which package allow calculate all distances from all nods to the root? Alexey. [[alternative HTML version deleted]] ___ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive

Re: [R-sig-phylo] Distances from nods to the root.

2014-05-20 Thread Liam J. Revell
Hi Alexey. If you want the set of internal node heights for an object of class phylo (these will also be the distances from the root), you can use: library(phytools) ## must be =0.4-05 h-setNames(sapply(1:tree$Nnode+length(tree$tip.label),nodeheight,tree=tree),