Rmarkdown 输出显示 table 以 kable 样式和常规样式打印

Rmarkdown output shows a table printed both in kable style and regular style

我的代码如下:

kable(knit_print(func), format = "html", col.names = c("Point Name", "CFU count"))%>%
kable_styling(bootstrap_options = c("striped", "hover"))

每当我编写 Rmd 文档时,它都会显示 table 我正在打印 (func) 和 'regular' 打印版本的精美排列版本 (## # A tibble: 5 x 2 , 并在下方显示 table).

如何才能只打印'beautiful'版本?我一天前开始使用 Rmarkdown,但我仍然对格式有点迷茫,非常感谢。

另外,这是我从易慧那里学到的一个技巧。我假设您知道 kableExtra 的文档站点。

https://haozhu233.github.io/kableExtra/awesome_table_in_html.html

如果将最后一个“.html”替换为“.Rmd”。您将获得此文档的 rmarkdown 文件。

最后,这对我来说是成功的。块选项显然很重要,感谢您的反馈:)。我发的是最终版,效果更漂亮。

{r echo = FALSE, results = 'hold'}
kable(func, format = "html", col.names = c("Point Name", "CFU count"), caption="Number of samples with 1 CFU grouped by point")%>%
kable_styling(bootstrap_options = c("striped", "hover"))