如何使用 R 中的官员在 powerpoint 中导入外部幻灯片?

sik*_*utz 5 powerpoint r officer

我想使用R中的官员将两张幻灯片的内容从两个pptx文件复制到一个pptx文件中。

我从以下代码开始:

slide1 = read_pptx('1.pptx') 
slide2 = read_pptx('2.pptx') 
slide2_content = slide2 %>% slide_summary() 
Run Code Online (Sandbox Code Playgroud)

现在 - 如何从附加到幻灯片 1 的幻灯片 2 中获取所有内容并将其保存到新文件中?

小智 0

我找到了一个“向后”的解决方法:

my_pres <- read_pptx(path = "one_slide.pptx") # The pptx can have any number of slides
my_pres <- add_slide(my_pres)
my_pres <- ph_with(my_pres, "Hello world", location = ph_location_type(type = "title"))
move_slide(my_pres, 1,length(my_pres))
print(my_pres, target = 'one_slide_appended.pptx')
Run Code Online (Sandbox Code Playgroud)

但这限制了包含来自单一来源的幻灯片