I was wondering whether it was possible to disable chunk output for RStudio's html_notebook
s in the Source pane, so that output is only displayed in the Viewer pane (or in a separate Window, depending on your settings).
- I can manually close output of a single chunk in the Source pane by clicking on the "x" on the right of a code chunk, but this seems tedious.
- I can also control output with
include=FALSE
, but this obviously also affects the Viewer pane where I would like to have my output displayed. - Edit: I would like to stick with the
html_notebook
format as updating changes with the notebook preview is much faster than knitting anhtml_document
.
Minimal Working Example (saved as test.Rmd
):
---
title: "R Notebook Test"
output: html_notebook
---
HSome text here.
```{r chunk1}
2+2
```
Some more text here.
The MWE results in the following output in the Source pane ...
... and the following output in the Viewer pane:
I am happy with the Viewer pane but do not want to see the output in the Source pane.
Why am I asking this question?
I think the option of having output displayed in the Source pane is nice but since inline code chunks are not also rendered in the Source pane I prefer just having the output displayed once in the Viewer pane.