我正在使用R officer包在Powerpoint幻灯片中,需要将文本插入5个相同的占位符中,这些占位符都位于幻灯片底部一排中相邻的位置。在ph_with_text函数被弃用之前,可以使用body和index参数来指定要插入文本的确切占位符。然而,我无法找到一种正确使用较新的ph_with函数的方法。
为了上下文,textholder的layout_properties如下:
type id ph_label offx offy cx cy
body 25 Text Placeholder 24 2.4526826 5.9722200 1.340278 0.7065978
body 26 Text Placeholder 24 4.2022332 5.9722200 1.340278 0.7065978
body 27 Text Placeholder 24 5.9965278 5.9722211 1.340278 0.7065978
body 28 Text Placeholder 24 7.7013342 5.9722200 1.340278 0.7065978
body 29 Text Placeholder 24 9.4496063 5.9722200 1.340278 0.7065978
如果我使用ph_location_label,我只能指定第一个位置,像这样:
ph_with(location = ph_location_label(ph_label = "Text Placeholder 24"), value = "Blah blah"
我可以使用position_right参数来指定最后一个位置:
ph_with(location = ph_location_type(type = "body", position_top = F, position_right = T), value = "Blah blah")
但是我在中间的三个位置上遇到了困难 - 我该如何指定这些占位符?有没有办法更改它们的ph_label,使其不都是“文本占位符24”?