R eps export and import into Word 2010

后端 未结 5 483
别跟我提以往
别跟我提以往 2020-12-18 06:29

I\'m having trouble with exporting eps files from R and importing into Word 2010.

I\'m using ggplot2 plots, eg

library(ggplot2)
p <-          


        
5条回答
  •  眼角桃花
    2020-12-18 06:44

    Word indeed doesn't support EPS very well. A better solution is to export your graphs to Word or Powerpoint directly in native Office format. I just made a new package, export, that does exactly that, see https://cran.r-project.org/web/packages/export/index.html and for demo https://github.com/tomwenseleers/export

    Typical syntax is very easy, e.g.:

    install.packages("export")
    library(export)
    library(ggplot2)
    qplot(Sepal.Length, Petal.Length, data = iris, color = Species, 
          size = Petal.Width, alpha = I(0.7))     
    graph2doc(file="ggplot2_plot.docx", width=6, height=5)
    graph2ppt(file="ggplot2_plot.pptx", width=6, height=5) 
    

    Output is vector format and so fully editable after you ungroup your graph in Word or Powerpoint. You can also use it to export statistical output of various R stats objects.

提交回复
热议问题