Opens an officer document you can build up with the report_add_*()
helpers and write out with report_save(). This is the "build slides/Word
directly from R" path; for a Quarto-based workflow see scaffold_report().
Arguments
- format
"pptx"(default) for PowerPoint or"docx"for Word.- template
Optional path to a
.pptx/.docxto use as the style template (reference doc).NULL(default) uses the brand template registered byuse_brand(), falling back to one of the package's built-in 16:9 templates (seestyle).- style
Which built-in template to fall back on when no
templateand no brand template are set."elevated"(default) is the styled deck: a navy/gold identity with a full-bleed navy cover, full-bleed navy section dividers, a navy title over one slim rule on every content slide and slide numbers in the corner."plain"is the same widescreen deck with the same palette but no decoration – plain white slides. Ignored when a template is supplied.- slide_numbers
If
TRUE(default), every content slide added withreport_add_slide()shows the template's slide-number placeholder in its usual corner. Requires the suggestedxml2package (silently skipped without it, or when the template has no slide-number placeholder).- keep_slides
PowerPoint only. If
TRUE(default), any slides already in the template stay and your first slide is added after them. SetFALSEto start from an empty deck, which is what you want when the template carries example or boilerplate slides you do not intend to ship.
Details
This is the "build it from R" path: you get an officer document and
add to it slide by slide (pptx) or section by section (docx) with the
report_add_*() helpers, then write it out with report_save(). Slide
layouts are chosen by inspecting the template's placeholders, so any
organisation template works – see report_layouts() for what yours
contains. For a quick deck from a list of charts and tables, report_deck()
does the whole thing in one call; for a document-driven workflow,
scaffold_report() gives you a Quarto template instead. Requires the
suggested officer package.
See also
report_add_slide(), report_add_plot(), report_add_table(),
report_save(), report_deck(), report_layouts(), use_brand().
Other reporting:
example_report(),
list_report_templates(),
report_add_plot(),
report_add_slide(),
report_add_table(),
report_add_text(),
report_deck(),
report_layouts(),
report_save(),
report_section(),
report_slide(),
report_title_slide(),
scaffold_report()
Examples
doc <- report_new("pptx")
class(doc)
#> [1] "rpptx"
# a corporate template replaces the built-in one:
# report_new("pptx", template = "brand/org-template.pptx")
