Thursday, June 13, 2013

Common error in contMap

This is a commonly reported error from the function contMap:

contMap : Error in while (x > trans[i]) { : missed value TRUE / FALSE is required

I believe this is usually due to branches of zero length in the tree. For internal branches of zero length, this can be resolved using:



  1. Hi Liam,
    I've been getting this error even after using your suggestion, within the code you posted for multi-plot phylomorphospaces with contMap. Is there anything else that might give me this warning? Admittedly, the tree I'm using has a lot of polytomies, but I don't know if that's an issue.

    1. Hi Kara. The problem can also be very short edges. You can try collapsing those into polytomies by increasing the value of tol in di2multi. You can also increase res in contMap & this may also address your issue. Feel free to send me your data & code to troubleshoot. All the best, Liam

    2. Thanks, Liam! I'll have a go at it, and let you know if this works.

  2. That worked perfectly--I had to change both parameters.

  3. Just a note that I got this error for a tree with no ~0 branch lengths, but with data stored as a frame rather than a vector (i.e. as the output from geiger::treedata). I know that's user error, but just figured I'd put it somewhere on the web in case anyone else was getting buggered by this! Also, a big thank you Liam, phytools is making my life much easier right now.

  4. This comment has been removed by the author.

  5. Hi Liam, I did just that, but I was unsuccessful. What do you think about this error? Can you help me, please?A big thank you!


Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.