Sunday, May 1, 2011

Update to ltt() and calculation of the gamma-statistic

I just updated my lineage-through-time calculation & plotting function ltt(). The updated code is available on my R-phylogenetics page (direct link here). This function does not add much to what is already available with Dan Rabosky's great {laser} package for diversification analyses; but it does allow one to create an LTT plot with extinct tips, which I do not believe is permitted in prior implementations.

I fixed a couple of bugs in this update. The most significant of these created a bug for any tips with zero length. The second, caused an error if the user told the function to drop extinct tips, but in fact all tips in the tree were contemporaneous.

In addition to these bug fixes, I also just added the optional computation of Pybus & Harvey's (2000) γ statistic, along with a two-tailed P-value for this test.

Load and run as follows (with a simulated tree from {geiger}'s birthdeath.tree() as an example):

> source("ltt.R")
> require(geiger)
> tree<-birthdeath.tree(b=1,d=0,taxa.stop=100)
> ltt(tree)
    101 102 103 112 ... 
  1   2   3   4   5 ...
                101       102       103       112  ...
0.0000000 0.0000000 0.3710933 0.7407788 1.0535915  ...
[1] -0.2348588
[1] 0.8143183

No comments:

Post a Comment