Hello

On Fri, Sep 10, 2010 at 11:27 AM, Graham Smith
<[email protected]> wrote:
> SWeave and Lyx are a great combination for combining R code and R output
> into the same document and most of the time this is fine, but occasionally I
> need a 2nd version without the code, but still any graphs produced by the
> code.
>
> I did try branches, but switching off a branch, which runs a calculation
> that a figure relies on, breaks the figure code.
>
> I also tried putting the code in an appendix, but this has a similar problem
> with the figure code calling data that hasn't yet been created.
>
> Has anyone any idea how this can be got around, and give me the two document
> versions: one with code and one without.
>
Have you tried to use \SweaveOpts{echo=T} for the with_code document,
and 'echo=F' for the document with no code? You can also use this
option on specific chunks as follows
<<echo=F>>=
@

You might be able to play with these to tailor the document as needed.
Let us know if this solves your issues.
Liviu



> I could live with all the code ending up in an appendix, and wondered if
> there was some clever way of working with two files, one for the analysis
> that would run first, then the main document could grab output from this
> analysis file for the main text, and then dump the analysis file into the
> compiled document as an appendix. If that makes sense.
>
> Any suggestions gratefully received.
>
> Graham
>
>



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

Reply via email to