Using ReporteRs
package we can create power point presenation from R code.
I tried to create a power point slide having a centered title.
Here the basic code I am using to create the slide:
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" )
This creates a slide with title positioned at the left. Unfortunately addTitle
don't expose any argument to format text or change its position. I looked also in the package options :
options()[grep('ReporteRs',names(options()))]
but without success.
One solution is to use a predefined template (as commented below my question) To create a template:
basic_template.ppx
Now in the R code to use this template :