[R] Sweave and echoing code chunks conditionally

Sean Davis sdavis2 at mail.nih.gov
Mon Oct 6 21:27:14 CEST 2008


I have started to use Sweave to prepare reports for "end-users" of
statistical analyses.  For these users, there is not generally
interest in the code used to accomplish the analysis, but only the
results.  However, sometimes I would like to prepare the same
document, but with code chunks echoed, for my own use "on-the-fly"
when discussing the statistical results.  Is there a convenient way to
set things up so that with a single switch I can change things like
echo behavior throughout a document?  Of course, a quick sed script
would do the trick, but I was interested in other ideas?

Thanks,
Sean



More information about the R-help mailing list