在 Rmarkdown 中自动将表格放入选项卡中
我想在自动的不同选项卡中放置从中生成的表。我从,
但对于表来说不正常。它创建了标签,但没有显示它们中的表格。有人可以纠正我的代码吗?
---
output: html_document
---
# title 1 {.tabset}
There should be one table in each tab.
```{r echo=FALSE, warning=FALSE, results='asis'}
for(Species in levels(iris$Species)){
cat('\n##', Species, '\n')
p <- iris[iris$Species == Species,]
knitr::kable(p)
cat('\n')
}
```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在循环的
中
打印您的表格:You have to
print
your tables within thefor
loop: