2

I am trying to automate a PowerPoint presentation deck using officer in R. I am mostly working with the gt() package to make some tables (as I like the versatility of it) but the issue is that officedown requires me to save the gt() stuff as .png before I can paste it into powerpoint. This is all good and well but I would like to be able to modify the said table.

One of the great things about the gt() package is that I can save the table as a raw html format. However, I have no idea how to print the said html thing in the following code for my presentation.

my_pres <- pres %>%
 remove_slide(index = 1) %>% 
 add_slide(layout = "Title Slide", master = "Useless") %>%
 ph_with(value = "Gaetano was here" , location = ph_location_label(ph_label = "Title and Company Name")) %>%
 add_slide(layout = "Definitions", master = "Useless") %>%
 #ph_with(value = "Methodology & Definitions", location = ph_location_label(ph_label = "Methodology")) %>%
 ph_with(value = Definitions, location = ph_location_label(ph_label = "Definitions"),
         level_list = c(1L, 2L, 2L, 2L, 3L, 4L, 5L, 2L)) %>%
 add_slide(layout = "Graphs", master = "Useless") %>%
 ph_with(value = extimg3 , location = ph_location_label(ph_label = "Graphs"))  # extimg3 is where I want my table to appear. 

I am not working in markdown as I do not believe that markdown works with officer.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • HTML won't be understood by PowerPoint. officer work with flextable package (I am the author, it answers all my customer needs, but I may be biased). To get editable tables, that's the only solution I am aware of. – David Gohel Apr 28 '22 at 10:10
  • Hello, I figured as much. Is there a way to transform the html table to a flextable? I know flextable works with dataframes and I have been unsuccessful in translating the HTML table to flextable – Gaetano Dona-Jehan Apr 28 '22 at 15:58

0 Answers0