有没有办法在global chunk options中使用html_notebook
s?
此html_document仅显示标题(根据MWE的要求):
---
title: "Test"
output:
html_document
---
```{r setup, echo=FALSE}
library(knitr)
opts_chunk$set(echo=FALSE, results='hide', fig.keep='none')
```
```{r}
1+1
plot(1:5, 1:5)
```
然而,与html_notebook
完全相同的文档显示了所有代码块和输出(忽略了全局块选项):
---
title: "Test"
output:
html_notebook
---
```{r setup, echo=FALSE}
library(knitr)
opts_chunk$set(echo=FALSE, results='hide', fig.keep='none')
```
```{r}
1+1
plot(1:5, 1:5)
```
我不认为这是有意的,因为我可以直接向块提供块选项并获得所需的结果(仅标题):
---
title: "Test"
output:
html_notebook
---
```{r setup, echo=FALSE}
library(knitr)
```
```{r echo=FALSE, results='hide', fig.keep='none'}
1+1
plot(1:5, 1:5)
```