title: Still getting error in dev.off() : cannot shut down device 1 (the null device)
body: <p>I am new to R so I dont exactly know what kind of information to provide to get help but here it goes:
  I get the error "Error in dev.off() : cannot shut down device 1 (the null device)" when I try to make a plot... any plot. My latest code is:</p>
  
  <pre><code>pdf("spec_accum_w_sample.pdf")
  plot(specaccum(counts))
  dev.off()
  </code></pre>
  
  <p>An empty pdf file and a plot get successfully produced but when I write dev.off() it does not write into the created pdf. Instead I get the error above. I have tried restarting RStudio as well as anything else suggested on this link:
  <a href="https://stackoverflow.com/questions/44336215/error-in-dev-off-cannot-shut-down-device-1-the-null-device/50025932#50025932">Error in dev.off() : cannot shut down device 1 (the null device)</a>. I have also tried the initial code suggested on the ticket to re-create the author's pie chart, but still get the same error despite trying all of the suggestions</p>
  
  <p>I do not find any other place that addresses this specific error. I am running
  R version 3.4.4 (2018-03-15)
  Platform: x86_64-apple-darwin15.6.0 (64-bit)
  Running under: macOS Sierra 10.12.6</p>
  
  <p>Is there anything else I can try? Am I supposed to install something or update something to get dev.off() to work? </p>