Tuesday, April 9, 2013

Small bug fix in make.simmap for multiple input trees

For some reason in a recent version of make.simmap with multiple input trees I had the brilliant idea that it would be smart to print Done. at the end of every set of simulations. The consequence of that self-inflicted wound is a fatal error when multiple input trees are read in! This is because I evaluate the optional argument message inside a conditional if(class(tree)=="phylo"), but then try to compute if(message) message("Done.") outside that if statement. The result is that, after calling itself recursively many times, at the very end make.simmap fails when trying to evaluate if(message). Oh no!

I also identified a different, non-fatal bug that affected make.simmap(...,nsim=1) for multiple input trees. This bug came about because for every input tree I called make.simmap(...,nsim) and then non-recursively unlisted the resulting object. The problem is that if nsim=1 then the non-recursive unlisting unlists the tree object. Oops!

Both of these bugs are in the latest CRAN release, which is annoying - but I have posted fixed code for make.simmap here and an updated build of phytools (phytools 0.2-42).

No comments:

Post a Comment