Hi Liam & Rob,

You may try using dist.nodes() for this:

x <- dist.nodes(phy)
n <- Ntip(phy)
ROOT <- n + 1
x[ROOT, ]

The last command returns the distance from the root to all nodes and tips which are ordered in the usual way. So you may create a vector with +1 for the nodes, -1 for the tips, and drop the tips not extinct. Then you sort on the values of x, and plot cumsum() of the vector of +/-1 against them.

I can add this to ape if there's a general interest for it.

Best,

Emmanuel

Liam J. Revell wrote on 11/08/2011 11:05:
Hi Rob.

I can reproduce your error, but I haven't figured out the problem yet.

You can try an earlier version of this function, which seems to work:

source("http://anolis.oeb.harvard.edu/~liam/R-phylogenetics/ltt/v0.3/ltt.R";)
p2 <- ltt(t1, log.lineages=FALSE, drop.extinct=FALSE)

Sorry about this.

Also:

max(p1$times)==max(p2$times)

can be FALSE because if drop.extinct is set to TRUE, then the crown age of the pruned tree can be smaller than in the full tree if some lineages arising at the root of the tree do not leave any extant descendants.

- Liam


--
Emmanuel Paradis
IRD, Jakarta, Indonesia
http://ape.mpl.ird.fr/

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to