title: How do I track down where a R package function fails?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4442518/general-suggestions-for-debugging-r">General suggestions for debugging R?</a>  </p>
  </blockquote>
  
  
  
  <p>I've encountered an error when calling a function from an R package. Briefly, </p>
  
  <pre><code>&gt; library(treemap)
  &gt; ...
  &gt; tmPlot(X,index=c("r1","r2","r3","r4"),vSize="size")
  Error in if (maxI == 1) { : missing value where TRUE/FALSE needed
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/5034748/treeemaps-with-more-than-two-levels-in-r">This SO</a> question gives more details.</p>
  
  <p>I examined  the source code of <code>tmPlot</code> by typing <code>tmPlot</code> at the R prompt, but the line that fails doesn't appear in the function. Which means, I assume, that it's failing in some function called by <code>tmPlot</code>. </p>
  
  <p>What's the best way to track this down? For example, can I generate a stack trace somehow? Is there an interactive debugger that will allow me to step through and see where the error happens?</p>