Skip to content
Prev 305956 / 398506 Next

Sweave - if \Sexpr{} than \SweaveInput{"my.Rnw"}

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 document. See
http://yihui.name/knitr/

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Thu, Sep 20, 2012 at 7:47 AM, Witold E Wolski <wewolski at gmail.com> wrote: