列出同一文档末尾的knitr类型文档的完整代码

时间:2015-01-13 23:04:50

标签: r knitr sweave r-markdown

One chunk silently generates output.

```{r, echo = FALSE}
summary(cars)
```

How can the same chunk be automatically listed at the end like this?

```
summary(cars)
```
带有参数knitr::purl

eval = FALSE如果存在则会起作用。

按名称列出单个块是理想的。

1 个答案:

答案 0 :(得分:5)

我在knitr book第一版的第12.1.4节中提到过,基本上是:

```{r ref.label=knitr::all_labels()}
```