inst/examples/example_move_slide.R

library(officer)

x <- read_pptx()
x <- add_slide(x, "Title and Content")
x <- ph_with(x, "Hello world 1", location = ph_location_type())
x <- add_slide(x, "Title and Content")
x <- ph_with(x, "Hello world 2", location = ph_location_type())
x <- move_slide(x, index = 1, to = 2)

Try the officer package in your browser

Any scripts or data that you put into this service are public.

officer documentation built on Jan. 17, 2026, 1:06 a.m.