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:

tree<-di2multi(tree)

6 comments:

  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.
    Thanks,
    Kara

    ReplyDelete
    Replies
    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

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

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

    ReplyDelete
  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.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete