title: problem saving pdf file in R with ggplot2
body: <p>I am encountering an odd problem.  I am able to create and save pdf file using R/ggplot2 and view them while the R Console is running.  As soon as I exit the R console, Preview on Mac OS X will no longer display the PDF.  I have been able to save .png files w/o problem, but for reasons beyond my control, I need to save in pdf files.  The code I am using to save is as follows:</p>
  
  <pre><code>  pdfFile &lt;-c("/Users/adam/mock/dir/structure.pdf")
    pdf(pdfFile)
    ggplot(y=count,data=allCombined, aes(x=sequenceName, fill=factor(subClass))) + geom_bar()
    ggsave(pdfFile)  
  </code></pre>
  
  <p>Has anyone encountered a similar problem? If so, what do I need to do to fix it?
  Thank you very much for your time.</p>