我有一个调用函数的r标记。该函数呈现另一个r标记文档,其中我在循环中包含kable。我无法打印在循环中调用的kable。
下面是一个代码示例:
# function definition
test.kable <- function(filename){
rmarkdown::render(filename)
}
#test.rmd
```{r,echo=FALSE,results='asis'}
对于(1:2中的i){
print(kable(head(Iris)
}
kable(尾部(虹膜))
#main r markdown in which I call the function
```{r,echo=FALSE,results='asis'}
test.kable("test.rmd")
循环内的kable永远不会被打印,而循环外的kable会被打印。有人能帮我弄清楚如何在循环中打印kable吗?
谢谢!
发布于 2018-10-20 03:34:56
这对我很有效。
#test.rmd
```{r,echo=FALSE,results='asis'}
对于(1:2中的i){
print(knitr::kable(head(Iris)
}
kable(尾部(虹膜))
发布于 2018-10-20 03:28:26
https://stackoverflow.com/questions/52898396
复制相似问题