在 RMarkdown 中将图像用作 table?
Use image as table in RMarkdown?
我很欣赏我正在尝试做的事情听起来很愚蠢,但请多多包涵。我想将 table 的现有图像(PNG)插入到将转换为 pdf 的 RMarkdown 文档中。有什么办法可以做到这一点,并将图像 视为 table 以便编号?也就是说,显然我可以做到

但问题是它将被编号为例如图 X,不是 Table Y。我希望它是 named/numbered 作为 table。
感谢您的任何建议。
看来我找到了用 kable
和 some 来完成的方法...这仍然有两条水平线,但暂时没问题:
```{r echo=F, warning=F}
temp.df = data.frame(image="")
temp.mat <- as.matrix(temp.df)
colnames(temp.mat) <- NULL
knitr::kable(temp.mat, caption="This is my caption")
```
编辑:根据@HoneyBuddha的建议,使用Bookdown时,必须添加标志format="pandoc"
,即knitr::kable(temp.mat, caption="This is my caption", format="pandoc")
我很欣赏我正在尝试做的事情听起来很愚蠢,但请多多包涵。我想将 table 的现有图像(PNG)插入到将转换为 pdf 的 RMarkdown 文档中。有什么办法可以做到这一点,并将图像 视为 table 以便编号?也就是说,显然我可以做到

但问题是它将被编号为例如图 X,不是 Table Y。我希望它是 named/numbered 作为 table。
感谢您的任何建议。
看来我找到了用 kable
和 some
```{r echo=F, warning=F}
temp.df = data.frame(image="")
temp.mat <- as.matrix(temp.df)
colnames(temp.mat) <- NULL
knitr::kable(temp.mat, caption="This is my caption")
```
编辑:根据@HoneyBuddha的建议,使用Bookdown时,必须添加标志format="pandoc"
,即knitr::kable(temp.mat, caption="This is my caption", format="pandoc")