0

I am trying to remove a slide and consequently add a slide with content using the OfficeR package. The read_pptx() function read the layout of the template uploaded without error but am running into trouble when modifying the template.

my_report <- report %>%
  remove_slide(index = 1) %>%
  officer::add_slide(layout = "Player Evaluation", master = "Office Theme") %>%
  officer::ph_with(value = name, location = ph_location_label(ph_label = "Player Name"))

The code above yields the follow error:

Error in x$presentation$slide_data() : attempt to apply non-function

Any help is appreciated!

Sotos
  • 51,121
  • 6
  • 32
  • 66
afc
  • 1
  • Welcome to SO! It's easier for others to help if you create a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). My guess is you might not have loaded the package which contains the `slide_data()` function (e.g. with `library(officer)`) but as I don't know what type of object `report` is, which packages you have loaded or which function is raising the error so it's hard to say anything concrete. – SamR Jan 10 '23 at 07:54

0 Answers0