我在用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')
自制模板(失败)
代码:
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")
|