使用ReporteRs
包我们可以从R代码创建power point presenation。
我尝试创建一个具有居中标题的power point幻灯片。
这里是我用来创建幻灯片的基本代码:
library( ReporteRs )
mydoc = pptx( ) # try adding argument: template = 'template.pptx' here
mydoc = addSlide( mydoc, "Title and Content" )
mydoc = addTitle( mydoc, "This is a title" )
writeDoc( mydoc, "pp_simple_example.pptx" )
这会创建一个标题位于左侧的幻灯片。遗憾的是,addTitle
不会公开任何参数来格式化文本或更改其位置。我也查看了包装选项:
options()[grep('ReporteRs',names(options()))]
但没有成功。
答案 0 :(得分:4)
一种解决方案是使用预定义的模板(如下面的问题所述) 要创建模板:
basic_template.ppx
现在在R代码中使用此模板:
mydoc = pptx( template='basic_template.pptx') ## give the whole path here