[R] Loops Sweave and Many Figures

Friedrich.Leisch@ci.tuwien.ac.at Friedrich.Leisch at ci.tuwien.ac.at
Sun Jan 12 17:15:03 CET 2003


>>>>> On Sun, 12 Jan 2003 06:03:41 +0100,
>>>>> Serguei  (S) wrote:

  > Is it any way?
  > This code doesn't work:
  > %%%%%%%%%%%%%%%
  > \multido{}{10}{
  > <<fig=T>>=
  > ...
  > @
  > }


\multido{}{10}{
<<fig=T,echo=F>>=
plot(1:10)
@ 
}


works while the samle with "echo=T" does not ... seems like multido
cannot hande verbatim enveronments, but that's hardly Sweave's fault.


> %%%%%%%%%%%%%%%
  > Or:
  > %%%%%%%%%%%%%%%
  > <<1, fig=T>>=
  > ...
  > @
  > <<>>=
  > <<1>>
  > @
  > %%%%%%%%%%%%%%%

what is that supposed to do? if you want a figure also resulting from
the second chunk you need

<<1, fig=T>>=
...
@
<<fig=T>>=
<<1>>
@

or

\SweaveOpts{fig=T}

<<1>>=
...
@
<<fig=T>>=
<<1>>
@



Hope this helps,

-- 
-------------------------------------------------------------------
                        Friedrich  Leisch 
Institut für Statistik                     Tel: (+43 1) 58801 10715
Technische Universität Wien                Fax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071      Friedrich.Leisch at ci.tuwien.ac.at
A-1040 Wien, Austria             http://www.ci.tuwien.ac.at/~leisch
-------------------------------------------------------------------




More information about the R-help mailing list