Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/davidgohel/flextable/llms.txt

Use this file to discover all available pages before exploring further.

save_as_pptx() writes one or more flextable objects to a PowerPoint file, placing each table on its own slide. This is a convenience function that wraps the officer package. For more control over slide layout and positioning, use the officer API directly.
PowerPoint ignores captions. The caption set by set_caption() is not included in PowerPoint output.

Function signature

save_as_pptx(..., values = NULL, path)

Parameters

...
flextable
required
One or more flextable objects, optionally named. Named objects use the name as a slide title.
values
list
A list of flextable objects (optionally named). Named elements are used as slide titles. If supplied, ... is ignored.
path
string
required
Path to the .pptx file to create.

Return value

A string containing the full path of the generated file.

Examples

Save a single table:
ft <- flextable(head(iris))
tf <- tempfile(fileext = ".pptx")
save_as_pptx(ft, path = tf)
Save multiple tables, each on its own slide:
ft1 <- flextable(head(iris))
ft2 <- flextable(head(mtcars))
tf <- tempfile(fileext = ".pptx")
save_as_pptx(`iris table` = ft1, `mtcars table` = ft2, path = tf)

See also

Build docs developers (and LLMs) love