kable_styling()导致消失的桌子

发布于 2025-01-26 08:32:18 字数 188 浏览 3 评论 0原文

由于某种原因,kable()起作用,但是每当我将其输送到kable_styling()中时,输出都是故障。在预览中,我可以在消失之前简要查看数值数据(如一秒钟)。现在只是一个空表。

加载的软件包是 图书馆(Gridextra) 图书馆(htmltools) 图书馆(Knitr) 图书馆(kablextra) 图书馆(sjplot) 图书馆(整洁)

For some reason, kable() works but whenever I pipe it into kable_styling(), the output is faulty. In the preview, I can briefly see the numerical data (for like a split second) before it disappears. It's just an empty table now.

The loaded packages are
library(gridExtra)
library(htmltools)
library(knitr)
library(kableExtra)
library(sjPlot)
library(tidyverse)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃素的狼 2025-02-02 08:32:18

我可以重现这个问题:

kable(iris[1:10,], "html", booktabs = T) %>% 
kable_styling(., full_width = TRUE, html_font = "arial")

在rstudio的R笔记本中,在管道提供在线表之前的代码,但是添加第二部分会导致表中的数据在吐痰第二秒后消失,如所述。

在Save_kable()中添加另一个管道确实会在保存的文件中生成一个图。在RSTUDIO中,在R脚本中运行代码也可以按预期生成图形。因此,大概问题与笔记本上下文中的rstudio解释有关。

I can reproduce the issue:

kable(iris[1:10,], "html", booktabs = T) %>% 
kable_styling(., full_width = TRUE, html_font = "arial")

In an R Notebook in Rstudio, code before the pipe gives an in-line table, but adding the second part causes the data in the table to vanish after a spit second as described.

Adding a further pipe to save_kable() does generate a plot in the saved file. Also running the code in an R script in Rstudio generates the graphic as expected. So presumably the problem is something to do with the RStudio interpretation of the in the context of a Notebook.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文