title: Phantom RStudio Errors
body: <p>I'm encountering some really odd behavior with <a href="/questions/tagged/rstudio" class="post-tag" title="show questions tagged &#39;rstudio&#39;" rel="tag">rstudio</a> <code>version 1.0.136</code> and <a href="/questions/tagged/r" class="post-tag" title="show questions tagged &#39;r&#39;" rel="tag">r</a> <code>version 3.3.2</code>, which unfortunately does not lend itself to a reproducible example. </p>
  
  <p>Whenever I force quit an <a href="/questions/tagged/rstudio" class="post-tag" title="show questions tagged &#39;rstudio&#39;" rel="tag">rstudio</a> project, I start getting these weird phantom error messages as thought <a href="/questions/tagged/rstudio" class="post-tag" title="show questions tagged &#39;rstudio&#39;" rel="tag">rstudio</a> is trying to run code which is not longer present in the project. This happens whenever I type anything in a saved script in the editor. </p>
  
  <p>Does anyone have any thoughts about how I might identify the root cause of this error? Or alternately how I could completely delete everything <a href="/questions/tagged/rstudio" class="post-tag" title="show questions tagged &#39;rstudio&#39;" rel="tag">rstudio</a> knows about the pre-crash project?</p>
  
  <p><strong>Updates</strong> </p>
  
  <p>It is somewhat code independent and has happened on a few projects. I don't actually see the code which it is trying to run, but only the error message which results, which is typically trying to load a file which doesn't exist, or calling a function which hasn't been loaded into memory. I tried the following things: </p>
  
  <ul>
  <li>Deleting the <code>.rproj</code> file and starting a new project in the same folder (no change)</li>
  <li>Reinstalling <code>R</code> (no change)</li>
  <li>Reinstalling <code>RStudio</code> (no change)</li>
  <li>Upgrading to <code>Sierra</code> (no change)</li>
  <li>Moving all files in a project to a new project in a new folder (problem solved, but re-occurs if there is a subsequent force-quit)</li>
  <li>Switching from a saved file to a new untitled file (problem solved, but re-occurs when new file is saved)</li>
  <li>Turning off "Restore previously open source documents at startup" (This seemed to have solved the problem at one point, but then it returned. So not a fix)</li>
  <li>Deleted <code>RStudio</code> and <code>Rstudio desktop directory</code> according to these instructions: <a href="https://support.rstudio.com/hc/en-us/articles/200554736-How-To-Uninstall-RStudio" rel="noreferrer">https://support.rstudio.com/hc/en-us/articles/200554736-How-To-Uninstall-RStudio</a> then reinstalling (Did not fix)</li>
  <li>Currently, when I run a script in a saved script it crashes <code>RStudio</code>, when I run it in an untitled file it works. Similarly when I run it in a base <code>R</code> console it works. </li>
  </ul>
  
  <p>So I think what's going on is that when <code>RStudio</code> quits unexpectedly, there's some reference to the initial file which is loaded by the loading <code>R</code> files at startup. </p>
  
  <p><strong>Edit</strong></p>
  
  <p>Related errors: 
  <a href="https://support.rstudio.com/hc/en-us/community/posts/220481907-Phantom-error-messages-on-RStudio" rel="noreferrer">https://support.rstudio.com/hc/en-us/community/posts/220481907-Phantom-error-messages-on-RStudio</a></p>