[R] Knitr: setting echo = FALSE globally

Rich Shepard rshepard at appl-ecosys.com
Tue Jul 21 16:37:16 CEST 2015


On Mon, 20 Jul 2015, John Kane wrote:

> I have no idea wha that chunk is not working but I think you can get the
> same result using the old method Stick the following in an ERT ...
>
> <<set-ops, echo = FALSE>>=
> opts_chunk$set(echo = FALSE)
> @

> Heck, I've only been using LyX for 4-5 years and already I'm sounding
> crotchety.

John,

   Crotchety is appropriate for situations like this.

   The above _almost_ works. Attached three PDF files show the results of
tests, all with the LaTeX code inserted.

   sample-no-chunk.pdf: removing chunk2 with its contents,
opts_chunk$set(echo=FALSE), did not keep the R code from displaying.

   sample-chunk-2-above.pdf and sample-chunk-2-below.pdf: chunk2 was prior
to, and following, the LaTeX code and all other R code did not echo, only
the chunk2 code displayed.

Thanks,

Rich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample-no-chunk.pdf
Type: application/pdf
Size: 69845 bytes
Desc: 
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150721/7bff7fa4/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample-chunk-2-above.pdf
Type: application/pdf
Size: 68938 bytes
Desc: 
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150721/7bff7fa4/attachment-0001.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample-chunk-2-below.pdf
Type: application/pdf
Size: 68938 bytes
Desc: 
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150721/7bff7fa4/attachment-0002.pdf>


More information about the R-help mailing list