5

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.

Mark Heckmann
  • 10,943
  • 4
  • 56
  • 88

1 Answers1

10

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

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419