Skip to content

master_name appear as NA in read_pptx, resulting in 'attempt to apply non-function' error on ph_with #488

Description

@csbu00

I created a simple slide template with a master template and several layouts, along with their placeholder (attached). Oddly, when I try to read_pptx, it seems to not be picking up the master template's name (it's reading as a null value)? This seems to result in error when using ph_with - I'm guessing it's because it couldn't process a null value. Have I perhaps done something wrong, either in the template creation or code, or is this a bug? Thank you!

Slide Template_R.pptx

library('tidyverse')
library('officer')

presentation <- officer::read_pptx('Slide Template_R.pptx')
template_object_map <- presentation %>% officer::layout_properties() %>% select(c('master_name','name', 'type', 'id', 'ph_label')) 

my_pres <- presentation %>% 
			remove_slide(index = 1) %>% 
			add_slide(master=NA, layout='Style_leftright_a') %>%
			ph_with(value= 'Corridors', location = ph_location_label(ph_label = "Big Title")) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions