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.
Is there currently a way to turn one of them off? Either regular sections or the code chunks.
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).
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 ...
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: ```{}...```
As per my comment: global options -> Rmarkdown -> show in document outline
change to show sections only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With