我已使用代码
将图表保存到我的cliboardx = 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")
使用RDCOMClient,我想将此图添加到我已打开的Powerpoint演示文稿中。
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]]
我知道我可以使用PP = PPT.AddGraphicstoSlide(PP),但这不允许进行相同的自定义。也就是说它没有从我的情节中带来“bg ='透明'”效果;它改为制作一个白色的方形bakground,覆盖我在后台写的文字。我可以轻松地手动修复此问题,但我会在多个演示文稿中生成数百个图表,并希望自动化。有没有办法将以wmf格式保存到剪贴板的图形粘贴到正确幻灯片中的powerpoint演示文稿中?谢谢你的帮助