I have saved a graph to my cliboard using the code
x = c(1:5)
y = c(1:5)
windows(504, 360) #opens a separate window with the size you want
plot.new()
plot(x,y, bg = "transparent")#my graph has more information but this would work
savePlot("clipboard", type="wmf")
using RDCOMClient, I would like to add this graph to my Powerpoint Presentation that I have open.
PP = PPT.Init(visible = FALSE, method = "RDCOMClient")
PP = PPT.AddTitleSlide(PP, title = "test")
PP = PPT. AddTextSlide(PP, text = "This text will be covered if the graph is in the wrong place")
presentation = PP$pres
slide2 = presentation[["Slides"]][[2]]
I know I can use PP = PPT.AddGraphicstoSlide(PP) but this does not allow for the same customization. Namely it does not carry over the "bg = 'Transparent'" effect from my plot; it instead makes a white square bakground that covers the text I am writing in the background. I can easily fix this manually but I am generating hundreds of graphs into multiple presentations and would prefer it to be automated. Is there a way to paste my graph that is saved to the clipboard in wmf format into my powerpoint presentation at the correct slide? Thanks for the help