title: R eps export and import into Word 2010
body: <p>I'm having trouble with exporting eps files from R and importing into Word 2010.</p>
  
  <p>I'm using <code>ggplot2</code> plots, eg</p>
  
  <pre><code>library(ggplot2)
  p &lt;- qplot(disp,hp,data=mtcars) + stat_smooth()
  p
  </code></pre>
  
  <p>Even after calling <code>setEPS()</code> neither of the following produce files which can be successfully imported.</p>
  
  <pre><code>ggsave("plot.eps")
  
  postscript("plot.eps")
  print(p)
  dev.off()
  </code></pre>
  
  <p>The strange thing is that if I produce the plot using <code>File</code> -> <code>Save As</code> -> <code>Postscript</code> from the menu in the GUI, it can be imported correctly. However, when the Word document is subsequently exported as a pdf, the fonts in the graphic are a little jagged.</p>
  
  <p>So my questions are:</p>
  
  <ul>
  <li>What combination of (<code>ggsave</code>/<code>postscript</code>) settings allows me to produce eps files that can be imported into Word 2010?</li>
  <li>How can I ensure the fonts remain clear when the Word document is exported as a pdf?</li>
  </ul>
  
  <p><strong>Update</strong></p>
  
  <p>After more investigation I have had more luck with <code>cairo_ps</code> to produce the plots. However, no text shows up when imported into Word.</p>
  
  <p>Furthermore, after checking the various eps outputs (<code>cairo_ps</code>, save from the GUI, <code>ggsave</code>) in a latex document, it seems like the eps import filter in Word quite poor as the printed/pdf output doesn't match the quality of the latex'd document. The <code>ggsave</code> version (which uses <code>postscript</code>) did have some issues with colours that the other two methods didn't have though.</p>
  
  <p>The conclusion is that this is a Word issue and therefore <code>fortune(109)</code> does not apply. I'd be happy to be proven otherwise, but I'll award the answer and the bounty to whoever can provide the commands that can replicate the output from the GUI in command form.</p>