我在用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')
[img]file:///C:\Users\MGES\AppData\Roaming\Tencent\Users\547262265\QQ\WinTemp\RichOle\%[]DLJY06$%L5UE)QYFW]4U.png[/img]
自制模板(失败)
代码:
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")
file:///C:\Users\MGES\AppData\Roaming\Tencent\Users\547262265\QQ\WinTemp\RichOle\91LCRR7ZVK0%9KFOHFA6R4R.png
|