According to the ReporteRs documentation ReporteRs this should be relatively simple. As @lawyeR says, this is about bookmarks. You can find examples from the author of the package here .
As an example, almost verbatim, from this link, the code will look like this:
mydoc = pptx(template = 'examples/pp_simple_example.pptx' ) myplot = qplot(Sepal.Length, Petal.Length, data = iris, color = Species, size = Petal.Width, alpha = I(0.7)) # This is the important line, note the 'bookmark' pertaining to slide mydoc = addSlide( mydoc, slide.layout = 'Title and Content', bookmark=2) # change title mydoc = addTitle( mydoc, 'my new graph') # add the plot mydoc = addPlot( mydoc, print, x = myplot ) # save changes to new file writeDoc( mydoc, 'examples/pp_replacement.pptx' )
As mentioned below, the maintainer fixed the error. Now you can replace the slides. As you noticed, this will replace the entire slide. Despite a slight inconvenience at the beginning, you can easily customize the script to add the same name, text, etc. to the slide, and you can easily copy the slide over and over again. At the same time, you can also quickly change any text if something changes (food for thought).
source share