[R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Witold E Wolski
Depending on an R computation I would like to include an Sweave documents in the main Sweave document. How can I do it? So I was thinking to use Latex features : \newif\ifpaper \ifpaper \SweaveInput{my1.Rnw} \else \SweaveInput{my2.Rnw} \fi But how do I set paper to true or false given

Re: [R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Duncan Murdoch
On 20/09/2012 8:47 AM, Witold E Wolski wrote: Depending on an R computation I would like to include an Sweave documents in the main Sweave document. How can I do it? So I was thinking to use Latex features : \newif\ifpaper \ifpaper \SweaveInput{my1.Rnw} \else \SweaveInput{my2.Rnw} \fi

Re: [R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Yihui Xie
If you want to program Sweave documents, you can try the knitr package. This case will be something like: = paper - TRUE # or change it to FALSE @ child=if (paper) 'my1.Rnw' else 'my2.Rnw'= @ i.e. you use the logical variable 'paper' to control which child document to include in the parent

Re: [R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Duncan Murdoch
On 20/09/2012 9:05 AM, Duncan Murdoch wrote: On 20/09/2012 8:47 AM, Witold E Wolski wrote: Depending on an R computation I would like to include an Sweave documents in the main Sweave document. How can I do it? So I was thinking to use Latex features : \newif\ifpaper \ifpaper