html_notebook忽略全局块选项

时间:2017-01-28 15:27:24

标签: r rstudio knitr r-markdown

有没有办法在global chunk options中使用html_notebooks

此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)
```

0 个答案:

没有答案