The building block behind every placeholder slide type: checks the template
has the layouts the slides use, adds each slide described by
placeholder_slide(), fills its placeholders and moves it into place, then
optionally saves the deck.
Usage
append_placeholder_slides(
doc_o,
slides,
to_page = NA,
doc_original = NULL,
save_file = FALSE,
layouts = placeholder_layouts(),
metadata = NULL,
type = "placeholder"
)Arguments
- doc_o
Path to the
.pptxfile. Read whendoc_originalisNULL, and used to name the saved file.- slides
A
listofplaceholder_slide()descriptions, inserted in order.- to_page
Page for the first slide; the others follow it.
NAappends after the last slide.- doc_original
An optional
officer::rpptxobject to add to.- save_file
If
TRUE, the deck is saved next todoc_owith a_<type>suffix.- layouts
The role lookup, see
placeholder_layouts().- metadata
Optional named
listof values for{token}s in the text, seeapply_tokens().- type
Suffix for the saved file.
Examples
deck <- tempfile(fileext = ".pptx")
print(officer::read_pptx(system.file("theme/basic.pptx", package = "autoslider.core")), deck)
doc <- append_placeholder_slides(deck, list(
placeholder_slide("section", title = "{study} safety", text = "Data cut-off: 01-JAN-2026"),
placeholder_slide("title_content", title = "Key findings", content = c("Point 1", "Point 2"))
), metadata = list(study = "BP12345"))
length(doc)
#> [1] 3