Global comment option for R markdown in knitr

To change the leading characters to exit, the knitr piece in .Rmd has a comment parameter, for example

```{r comment = ""} 1:100 ``` 

Is there a way to set this globally, and not separately for each fragment?

 opts_knit$set(comment = "") 

doesn't work, and I can't find it anywhere in the documentation.

+5
source share
1 answer

Use opts_chunk$set() because this is an option for chunk; opts_knit for package options (sorry for the similar names that apparently confused you). See http://yihui.name/knitr/options

+10
source

All Articles