Thursday, July 14, 2011

Updates and new version of "phytools" (v0.0-5)

I just posted a new version of the "phytools" package (here), v0.0-5. This version contains a few different updates.

1) I renamed the function min.split() to minSplit() and the function split.tree() to splitTree() to resolve generic/method inconsistencies. This is because R has generic functions min and split, but my functions don't comply with these generic methods. The renaming of splitTree() should not cause users any trouble, as this is called only from within posterior.evolrate(). Description of the use of min.split() can be found here and here; minSplit() works exactly the same way.

2) write.simmap() now writes to file in addition to a text string. It still only accepts modified "phylo" objects, and not "multiPhylo" lists of simmap trees; but allows for append=TRUE, which means that multiple simmap trees can be printed to file using a simple for() loop.

For instance:

> require(geiger)
> require(phytools)
> tree<-birthdeath.tree(b=1,d=0,taxa.stop=100)
> x<-sim.char(tree,model.matrix=list(matrix(c(-1,1,1,-1),2,2)), model="discrete")[,,1]
> mtrees<-make.simmap(tree,x,nsim=100)
> for(i in 1:length(mtrees)) write.simmap(mtrees[[i]],"testfile.trees",append=T)

3) Finally, I created a generic help page for "phytools":

> require(phytools)
> ?phytools

Good luck - and please post feedback if you try this version.


  1. Installed fine on my Windows machine! Thanks for adding a generic help page!

  2. Great. Thanks for the suggestion.