In knitr, no output from pander in for loop

假装没事ソ 提交于 2019-12-04 03:19:57
scoa

@daroczig answered in the comments :

  1. change knitr chunk option results to asis, either at the global level knitr::opts_chunk$set(results="asis") or at the chunk level ```{r,results="asis"}
  2. disable panderOption knitr.auto.asis : panderOptions('knitr.auto.asis', FALSE)

Cf. this issue

---
title: "Untitled"
output: html_document
---

Testing **when** pander doesn't work in for loop

```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.width=7, fig.height=5, echo=TRUE, warning=FALSE,
  message=FALSE)

```

```{r,results="asis"}
library(pander)
panderOptions('knitr.auto.asis', FALSE)

r <- 1:10

for (i in 1:2) pander(summary(r))

```
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!