Code

In the course of my research, I develop new methods for studying macroevolution. Most of these are implemented in the R programming language. Major methods will be implemented in a forthcoming release of the popular GEIGER package, maintained by Luke Harmon. I’m going to post some additional useful code and functions here.

Disparity through Time (with shaded confidence intervals and a p-value)

Figure 4This download is a folder containing a modified version of geiger’s disparity through time code (see Harmon et al. 2003, Science) that produces a DTT plot with pretty, shaded 95% confidence intervals. The code will also return a p-value for the morphological disparity index (MDI). This approach was described in our paper on Cetacean body size evolution (Slater et al. 2010 Proc Roy Soc). The data from that paper, plus an example script are also provided. NOTE: The original version of this function posted on my old UCLA website is not compatible with geiger versions 1.99 and above. This version is compatible with 1.99 onwards but has not been tested with older versions.

4 Responses to Code

  1. fuzzyatelin says:

    Hi Graham – thanks for posting your code for download! It’s been very helpful.

    Incidentally, I think I’ve found an error in your code posted above for dttFullCIs (‘dtt.full with confidence limits and p value.R’). In the final ‘return’ line, you define ‘times’ as the undefined variable ‘ltt’, which I think is a holdover from your previous coding for the older version of GEIGER. Changing ‘ltt’ to ‘dtt.data$times’ seems to solve the problem. Thanks again!

  2. gjslater23 says:

    Hi Fuzzyatelin,

    You’re quite right. Thanks for picking up on that. I’ve updated the code with the fix you pointed out.

  3. bf says:

    Hi Graham,

    It appears the link is down or no longer public for the dttFullCIs function. When you get a chance, could you please upload this again? It seems very useful.

    Thank you again for coding this out!

    Ben

  4. gjslater23 says:

    Hi Ben,

    Thanks for pointing this out. A dropbox clean-up meant I deleted the folder it was in by accident. It should be up again now.

    Graham

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s