Hi Rich,
It sounds like your approach with the chunks is equivalent to my approach. 
Somewhere I remember reading that the global chunk commands apply to everything 
'after' the global command--which once one thinks about it is sensible . 

Glad it's working.  R +knitr does save a lot of time once you get it working.

John Kane
Kingston ON Canada


> -----Original Message-----
> From: rshep...@appl-ecosys.com
> Sent: Tue, 21 Jul 2015 08:30:09 -0700 (PDT)
> To: r-help@r-project.org
> Subject: Re: [R] Knitr: setting echo = FALSE globally [RESOLVED]
> 
> 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 box:
>> 
>> <<set-ops, echo = FALSE>>=
>> opts_chunk$set(echo = FALSE)
>> @
> 
> John,
> 
>    My original response was too large (3 attached PDF files) and was held
> for
> moderator approval which is no longer needed.
> 
>    I found the magic solution; looks awkward, but it works.
> 
>    Near the top of the document (well before any R code) I insert a knitr
> chunk containing the directive, opts_chunk$set(echo=FALSE). This is
> immediately followed by an ERT box as above. The double whammy prevents R
> code from echoing ... except for the contents of the leading chunk
> itself.
> 
>    Adding the option, echo=FALSE, to that leading chunk prevents it from
> displaying.
> 
>    Note that both the chunk with opts_chunk$set() and the ERT is required
> to
> prevent R code from displaying. No chunk but ERT box does not stop the
> echoing.
> 
> Thanks for the pointer,
> 
> Rich
> 
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
Publish your photos in seconds for FREE
TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if4

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to