我正在尝试使用以下 R 代码在同一张幻灯片上编写一系列项目符号:
library(officer)
library(magrittr)
ppt <- read_pptx()
ppt <- ppt %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with_text(type = "title", str = "FFT power spectrum") %>%
ph_with_text(type = "body", str = "no visual discrimination") %>%
ph_add_par(level = 1L) %>%
ph_add_text(str = "whole trajectories")
print(ppt, target = "test.pptx") %>% invisible()
...失败了,说...
Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html, :
Premature end of data in tag p line 1 [77]
当我将级别参数更改为
ph_add_par(level = 2L)
它工作得很好(如小插图中所示:https ://cran.r-project.org/web/packages/officer/vignettes/powerpoint.html )
我在这里想念什么?