title: R: Not able to save the plot
body: <p>I am generating a plot which I am able to see in the RMarkdown output but whenever I am trying to save it, I am getting just a blank(white) image. I am just adding following two lines before and after plot</p>
  <pre><code>png(&quot;Output.png&quot;)
  #Plot code
  dev.off()
  </code></pre>
  <p>It was working. And suddenly it stopped working. Can someone help me on this??</p>
  <h1>edit</h1>
  <p>When I do it with <code>pdf</code></p>
  <pre><code>pdf(&quot;output.pdf&quot;)
  #plot code
  dev.off()
  </code></pre>
  <p>I am getting error as:</p>
  <pre><code>There was error opening this document. This document cannot be opened because it has no pages. 
  </code></pre>
  <p>Thanks.</p>