Skip to content
Prev 26885 / 398500 Next

Loops Sweave and Many Figures

> 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,