问题
To change the leading characters for the output a knitr chunk in .Rmd has a comment option, like
```{r comment = ""}
1:100
```
Is there a way to set this globally, not separately for every chunk?
opts_knit$set(comment = "")
does not work and I cannot find it anywhere in the documentation.
回答1:
Use opts_chunk$set()
because that is a chunk option; opts_knit
is for package options (sorry about the similar names which apparently confused you). See http://yihui.name/knitr/options
来源:https://stackoverflow.com/questions/11190281/global-comment-option-for-r-markdown-in-knitr