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!
 
    