layout_properties ( x = my_pres, layout = "Comparison", master = "Office Theme" ) master_name name type id ph_label ph offx offy 3 Office Theme Comparison body 13 Text Placeholder 12 5.0625000 4.8298611 9 Office Theme Comparison body 4 Content Placeholder 3 0.3927734 1.7009799 11 Office Theme Comparison body 11 Text Placeholder 10 0.3923611 4.8290453 12 Office Theme Comparison body 6 Content Placeholder 5 5.0625000 1.7009799 15 Office Theme Comparison body 5 Text Placeholder 4 5.0625011 1.2482754 16 Office Theme Comparison body 3 Text Placeholder 2 0.3927734 1.2583486 20 Office Theme Comparison dt 7 Date Placeholder 6 0.3927734 5.2135422 25 Office Theme Comparison ftr 8 Footer Placeholder 7 3.3125000 5.2135422 30 Office Theme Comparison sldNum 9 Slide Number Placeholder 8 7.3553718 5.2135422 34 Office Theme Comparison title 2 Title 1 0.392773
Couldn't find a nice way of formatting thsi but as you can see the type body has id of 13.
Now when I try to code this in:
GSK_Comparison <- function(PP,title,sub1,sub2,footer, table1,table2){
PP <- PP %>%
add_slide(layout = "Comparison", master = "Office Theme") %>%
ph_with_text(type = "title", str = title) %>%
ph_with_text(type = "body",index = 11, str = sub1) %>%
ph_with_flextable(value = table1,type= "body",index = 4) %>%
ph_with_text(type = "body",index = 13, str = sub2) %>%
ph_with_flextable(value = table2, type = "body", index = 6) %>%
ph_with_text(type = "dt", str = format(Sys.Date())) %>%
ph_with_text(type = "ftr",str = footer)
}
I get the following error message: Error in slide$get_location(type = type, index = index) : body can only have 6 element(s) but index is set to 11
But not sure why this is occuring as clearly there are ID's of 11 and 13 for the type of body
Thanks in advance!