[R] Question about Sweave

Elizabeth Purdom epurdom at stanford.edu
Mon Feb 27 20:34:00 CET 2006


Hi,

I'm not sure if Sweave questions should go to the general list, but it 
seems to be part of the core R package without a separate maintainer.

I am writing a tutorial for R in a latex file. I'd like to use Sweave, 
since this seems its ideal usage. The problem is that I want to 
purposefully put errors in and then the output that comes with it in the 
text of my tutorial. However the errors kill the function Sweave() in R 
when what I would like is for Sweave to just run it and include the error 
message as part of the output.

I have set options(error=NULL). It doesn't seem that the error options 
would affect Sweave in the right way, since an error in my .Rnw file causes 
an error in Sweave() itself, not just in the processing of the code, but 
maybe there's an error-handling system I don't know about that would do it. 
(I tried error=expression(NULL) but Sweave couldn't finish regardless). I 
don't see any options in the documentation of Sweave that allow this 
behavior, either.

Thanks,
Elizabeth




More information about the R-help mailing list