有关R语言制作ppt的问题

0

 我在用R语言制作ppt的时候,如果用系统自带的空白模板可以绘图,但用自己制作的模板无法绘图,求大神解答

系统自带模板   (成功)
代码:
library(ReporteRs)
library(ggplot2)

doc=pptx()
slide.layouts(doc)
doc=addSlide(doc,slide.layout="Title and Content")
doc = addPlot( doc, fun = function() barplot( 1:6, col = 2:7),
               vector.graphic = TRUE, width = 5, height = 4 )
writeDoc(doc,'misson_success.pptx')
绘出图形为:
绘出图形.png




自制模板(失败)
代码:
library(ReporteRs)
library(ggplot2)

doc=pptx()
slide.layouts(doc)
doc=addSlide(doc,slide.layout="内容与标题")
doc = addPlot( doc, fun = function() barplot( 1:6, col = 2:7),
               vector.graphic = TRUE, width = 5, height = 4 )

writeDoc(doc,file="misson_failed.pptx")


错误为:

错误提示.png




 
已邀请:
2

marxsong 2016-09-19 回答

不是sunos的话,要设置 offx = 7, offy = 0,的值
试下这个,例子里的:
library(ReporteRs)
library(ggplot2)

doc=pptx(template = "C:/Users/Public/Documents/doc.pptx")
slide.layouts(doc)
doc=addSlide(doc,slide.layout="标题和内容")

is_sunos <- tolower(Sys.info()[["sysname"]]) == "sunos"
if( !is_sunos ){
  doc = addPlot( doc,
                 fun = function() barplot( 1:6, col = 2:7),
                 vector.graphic = FALSE,
                 offx = 7, offy = 0,
                 width = 3, height = 2
  )
}
writeDoc(doc,file="misson_failed.pptx")


 
0

MGES 2016-08-16 回答

求大神解答,来个人吧
0

dj123jary 2016-08-18 回答

没研究过这块,抱歉
0

Robin_Li - R&Python机器学习讲师 2016-08-24 回答

没有使用R做PPT的经验,抱歉
0

结实 - 始终在寻找数据的落脚点与发光点。还好,让我赶上了这个大数据时代,感恩中前行~!在工作中学习,在学习中分享,在分享中传递,在传递中提升。come on。我是结实,我来了。 2016-09-18 回答

抱歉,没研究过

要回复问题请先登录注册