flextable::save_as_image() 包含 Rmarkdown 编织到 Word 时的图像路径

flextable::save_as_image() includes path to image when Rmarkdown knit to Word

当我将 Rmarkdown 编织到 Word 并包含使用 flextable::save_as_image() 另存为图像的 table 时,该函数似乎也在 table 上方粘贴了我的图像的路径。如何防止路径包含在Word文档中? 这是一个 MWE:

---
title: "MWE"
output: word_document
---

```{r include=TRUE, message=FALSE, warning=FALSE, echo=FALSE, results='asis'}
library(flextable, quietly = TRUE)
library(webshot, quietly = TRUE)
ft <- flextable( head( mtcars ) )
ft <- autofit(ft)
save_as_image(x = ft, path = "myimage.png")
knitr::include_graphics("myimage.png")
```

这是我得到的输出:

save_as_image returns 您将图像保存到的文件名。您可以使用 invisible().

隐藏它
invisible(save_as_image(x = ft, path = "myimage.png"))