Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide R code chunks from outline view in RStudio

When writing .rmd or .Rnw reports in RStudio, the outline view shows both code chunks and regular sections. While code chunks appear italic, regular sections do not. However, writing large reports with many similar named chunks will lead to a really bulky outline view with many similar labels.

enter image description here

Is there currently a way to turn one of them off? Either regular sections or the code chunks.

like image 666
pat-s Avatar asked Jul 26 '16 08:07

pat-s


People also ask

How do I hide a chunk code in R?

Chunk options The initial line in a code chunk may include various options. For example, echo=FALSE indicates that the code will not be shown in the final document (though any results/output would still be displayed). You use results="hide" to hide the results/output (but here the code would still be displayed).

How do I hide code in RStudio?

Hide source code: ```{r, echo=FALSE} 1 + 1 ``` Hide text output (you can also use `results = FALSE`): ```{r, results='hide'} print("You will not see the text output.") ``` Hide messages: ```{r, message=FALSE} message("You will not see the message.") ``` Hide warning messages: ```{r, warning=FALSE} # this will generate ...

How do I show code chunks in R markdown?

If you wrap this code within a markdown code block, the rendered output will display the verbatim R code chunk — including backticks. Start and end the R code chunk you want to display: ```{}...```


1 Answers

As per my comment: global options -> Rmarkdown -> show in document outline change to show sections only

like image 142
Philip Parker Avatar answered Sep 20 '22 23:09

Philip Parker