Skip to contents

The one-line-per-slide wrapper: starts a new slide, sets its title, and places content on it in a single call, so a deck script reads as one line per slide. content is dispatched by type – a ggplot becomes a chart, a data frame a table, a character vector a bulleted text box.

Usage

report_slide(
  doc,
  title = NULL,
  content = NULL,
  layout = NULL,
  master = NULL,
  ...
)

Arguments

doc

A document from report_new().

title

Slide title (typically the survey question the slide answers).

content

A ggplot, a data frame / tibble, or a character vector. NULL (default) adds an empty titled slide.

layout, master

Passed to report_add_slide(); NULL auto-selects.

...

Passed on to report_add_plot(), report_add_table() or report_add_text() depending on content.

Value

The updated document.

Details

Equivalent to report_add_slide() followed by the matching report_add_*() call, but as one pipe-friendly step so calc -> plot -> add collapses onto a single line: report_slide("How likely to recommend?", plot_nps(nps_value)).

Examples

# \donttest{
doc <- report_new("pptx") %>%
  report_slide("Who follows pod racing?",
               plot_bars(calc_percentage(podracing_survey, demo_gender)))
class(doc)
#> [1] "rpptx"
# }