![](/img/trans.png)
[英]How to display special characters in flextable save_as_image routine
[英]flextable::save_as_image() includes path to image when Rmarkdown knit to Word
當我將 Rmarkdown 編織到 Word 並包含使用flextable::save_as_image()
保存為圖像的表格時,function 似乎也將路徑粘貼到表格上方我的圖像。 如何防止路徑包含在 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")
```
這是我得到的 output:
save_as_image
返回您保存圖像的文件名。 您可以使用invisible()
隱藏它。
invisible(save_as_image(x = ft, path = "myimage.png"))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.