title: General suggestions for debugging in R
body: <p>I get an error when using an R function that I wrote:</p>
  
  <pre><code>Warning messages:
  1: glm.fit: algorithm did not converge 
  2: glm.fit: algorithm did not converge 
  </code></pre>
  
  <p><strong>What I have done:</strong></p>
  
  <ol>
  <li>Step through the function</li>
  <li>Adding print to find out at what line the error occurs suggests two functions that should not use <code>glm.fit</code>.  They are <code>window()</code> and <code>save()</code>.</li>
  </ol>
  
  <p>My general approaches include adding <code>print</code> and <code>stop</code> commands, and stepping through a function line by line until I can locate the exception.</p>
  
  <p>However, it is not clear to me using those techniques where this error comes from in the code. I am not even certain which functions within the code depend on <code>glm.fit</code>.  How do I go about diagnosing this problem?</p>