[R] Sweave and \input or \include LaTeX commands

Gabor Grothendieck ggrothendieck at myway.com
Sun Feb 27 01:57:34 CET 2005


If this were supported it should have a different command than the 
latex one or else one would not be able to do it at the latex level.
One might want to do it at the latex level rather than the Sweave
level in the case that one wants to have a vignette pass R CMD CHECK
but the vignette depends on software that is not generally available
or perhaps the vignette involves a large computation which would
otherwise impact every run of R CMD CHECK.  In these cases the portion
of the vignette that depends on the unavailable software or large
computation could be preprocessed using Sweave and then included
at the latex level to get by R CMD CHECK.

Gorjanc Gregor <Gregor.Gorjanc <at> bfro.uni-lj.si> writes:

: 
: Imagine this situation:
: 
: % --- a.Rnw start ---
: \documentclass{book}
: \usepackage{Sweave}
: \begin{document}
: % some toy example
: <<print=TRUE>>=
: x <- 1:10
:  <at> 
: % now we input additional file
: \input{a1}
: % and lets look again at x
: <<print=TRUE>>=
: x
:  <at> 
: \end{document}
: % --- a.Rnw end ---
: 
: % --- a1.Rnw start ---
: %\usepackage{Sweave}
: % add 1 to x
: <<print=TRUE>>=
: x <- x + 1
:  <at> 
: % --- a1.Rnw end ---
: 
: > Sweave("a.Rnw")
: Writing to file a.tex
: Processing code chunks ...
:  1 : echo print term verbatim
:  2 : echo print term verbatim
: 
: You can now run LaTeX on a.tex 
: 
: When you run Sweave on a.Rnw it founds only two chunks of R code. So it
: does not go into a1.Rnw i.e. it does not follow \input command. This 
: would be very usefull if one has such hierarchies in documents. Afcourse
: one can use Sweave on a.Rnw and a1.Rnw and then run LaTeX, but it would be
: nice if just one Sweave would do Sweave job for all files i.e. the same
: as LaTeX does. 
: 
: --
: Lep pozdrav / With regards,
:     Gregor GORJANC
: 
: ------------------------------------------------------------------------
: University of Ljubljana
: Biotechnical Faculty       URI: http://www.bfro.uni-lj.si/MR/ggorjan
: Zootechnical Department    email: gregor.gorjanc <at> bfro.uni-lj.si
: Groblje 3                  tel: +386 (0)1 72 17 861
: SI-1230 Domzale            fax: +386 (0)1 72 17 888
: Slovenia
: ------------------------------------------------------------------------
: 
: -----Original Message-----
: From: Mohamed Abdolell [mailto:m.abdolell <at> utoronto.ca]
: Sent: sob 2005-02-26 21:48
: To: Gorjanc Gregor; r-help <at> stat.math.ethz.ch
: Subject: RE: [R] Sweave and \input or \include LaTeX commands
: 
: I have used \input in my .Snw file and it works fine.
: 
: - Mohamed
: 
: -----Original Message-----
: From: r-help-bounces <at> stat.math.ethz.ch
: [mailto:r-help-bounces <at> stat.math.ethz.ch] On Behalf Of Gorjanc Gregor
: Sent: February 23, 2005 10:50 AM
: To: r-help <at> stat.math.ethz.ch
: Subject: [R] Sweave and \input or \include LaTeX commands
: 
: Hello!
: 
: I was just wondering if Sweave can work with \input or \include 
: LaTeX commands. So, is it aware of such a possible hierarchy in
: documents. I would test that, but I don't have such a report 
: available at the moment.
: 
: I thought of that when I was writting shell script for Sweave
: from command line and I have solved that part there.
: 
: --
: Lep pozdrav / With regards,
:     Gregor GORJANC
: 
: ---------------------------------------------------------------
: University of Ljubljana
: Biotechnical Faculty       URI: http://www.bfro.uni-lj.si
: Zootechnical Department    email: gregor.gorjanc <at> bfro.uni-lj.si
: Groblje 3                  tel: +386 (0)1 72 17 861
: SI-1230 Domzale            fax: +386 (0)1 72 17 888
: Slovenia
: 
: ______________________________________________
: R-help <at> stat.math.ethz.ch mailing list
: https://stat.ethz.ch/mailman/listinfo/r-help
: PLEASE do read the posting guide!
: http://www.R-project.org/posting-guide.html
: 
: ______________________________________________
: R-help <at> stat.math.ethz.ch mailing list
: https://stat.ethz.ch/mailman/listinfo/r-help
: PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
: 
:




More information about the R-help mailing list