# Create a new document
doc = pptx( title = "title" )
# add a slide with layout "Title Slide"
doc = addSlide( doc, slide.layout = "Title Slide" )
doc = addTitle( doc, "Presentation title" ) #set the main title
doc = addSubtitle( doc , "This document is generated with ReporteRs.")#set the sub-title
## add a page number on the current slide
doc = addFooter( doc, "Hi!" )
writeDoc( doc, "addFooter_example.pptx" )
Run the code above in your browser using DataCamp Workspace