on_slide: Change current slide

View source: R/pptx_slide_manip.R

on_slideR Documentation

Change current slide

Description

Change current slide index of an rpptx object.

Usage

on_slide(x, index)

Arguments

x

an rpptx object

index

slide index

See Also

read_pptx(), ph_with()

Other functions slide manipulation: add_slide(), move_slide(), remove_slide(), set_notes()

Examples

doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- on_slide(doc, index = 1)
doc <- ph_with(
  x = doc, "First title",
  location = ph_location_type(type = "title")
)
doc <- on_slide(doc, index = 3)
doc <- ph_with(
  x = doc, "Third title",
  location = ph_location_type(type = "title")
)

file <- tempfile(fileext = ".pptx")
print(doc, target = file)

davidgohel/oxbase documentation built on March 18, 2024, 4:09 p.m.