[R] Sweave running R chunks for figure generation several times

Florian Burkart florian.burkart at whu.edu
Fri Mar 26 16:51:10 CET 2010


Cheers thanks guys just wanted to make sure there isn't another option I 
could easily set to false.


On 26/03/2010 15:44, Greg Snow wrote:
> Is the order consistent?  Meaning that the pdf/eps producing run always comes second?
>
> If so, then set a variable to FALSE and when you get to the plotting code have an if statement on that variable, if it is FALSE then set it to TRUE, if it is TRUE then run the plotting code.  This way it only runs the 2nd time.  The only problems I can see is if the first default plot is needed to get some parameters for setting up the pdf/eps devices, and if you want to include the code (not just the plot) in the output then it will have the extra test.
>
> Using some form of cachesweave may be usefull here as well.
>
>



More information about the R-help mailing list