I was just trying to do this and I think I have a reasonable solution that
seems to be working well.
In the main document you can include a chunk with a logical section:
<>=
if(T){
{sink("/dev/null"); Sweave(’subsection.Rnw'); sink(); }
cat('\\input{subsection.tex}')
}
@
Then you can put y
Max,
Thank you very much! I'll give LaTeX a go (haven't used it in a while). Is
there a recommended distribution of LaTeX for Windows?
Aleksey
On Fri, Mar 5, 2010 at 1:50 PM, Max Kuhn wrote:
> That isn't hard to do with Sweave.
>
> Within you if branch, you can have your code write out any mar
I haven't used windows for a while... when I did I used MikTex and TeXnicCenter.
Max
On Fri, Mar 5, 2010 at 2:27 PM, Aleksey Naumov wrote:
> Max,
>
> Thank you very much! I'll give LaTeX a go (haven't used it in a while). Is
> there a recommended distribution of LaTeX for Windows?
>
> Aleksey
>
That isn't hard to do with Sweave.
Within you if branch, you can have your code write out any markup you
choose (including \section). For figures, I would suggest writing the
image file "manually" (i.e with the code chunk option fig = FALSE) and
also write out the \includegraphics statements too.
Its possible to do that using latex if/then/else macros which you can
find in latex package ifthen; however, once you are getting to that
level of complexity, Sweave is more of a hindrence than a help and is
probably no longer the appropriate tool for the job.
On Fri, Mar 5, 2010 at 12:55 PM, Alek
Dear R and Sweave users,
Is there a way to have optional sections in a Sweave-generated report
document, complete with section header(s), text and code chunks? In other
words, I'd like for my report to include or omit certain sections based on
the data itself.
For example, If I examine the input
6 matches
Mail list logo