使用官员函数 ph_with_vg_at 时出现以下错误:
Error in dml_pptx(file = dml_file, width = width, height = height, offx = left, :
argument "height" is missing, with no default
我认为问题在于我使用的“funWorkaround”包装器代替了 ph_with_vg_at。此功能可确保在写入 PPT 时正确编码某些字符(在此处偷了此功能)。当我使用 ph_with_vg_at 而不是 funWorkaround 时,我没有收到错误消息。
直到今天,当我更新了所有软件包时,这一切都运行良好。所以不确定这是官员/房车问题还是管道问题。或者以上都不是!
我正在寻找解决此错误或在从 R 写入 PPT 时找到另一种保留字符编码的方法。谢谢!
funWorkaround <- function(x, code, left, top, height, width, ...) {
# Re-Store old encoding on end
sOldEnc <- getOption("encoding")
on.exit(options(encoding=sOldEnc))
# Modify encoding
options(encoding="UTF-8")
# Create plot
return(ph_with_vg_at(x, code, left, top, height, width, ...))
}
ppt_test <- ppt_test %>%
add_slide(layout = "Two Content", master = "Office Theme") %>%
ph_with_text(type = "title", str = "Satisfaction with Issue Details") %>%
funWorkaround(code = print(issuedetails.plot),
left = 0.46,
top = 2,
width = 11.8,
height = 4.71)