[R] last.warning and Sweave?

Dieter Menne dieter.menne at menne-biomed.de
Tue Jun 9 21:11:21 CEST 2009


Ben Bolker <bolker <at> ufl.edu> writes:

>   Sweave does something clever with warnings, which I have so far been
...

>   I thought I could get around this with last.warning , but apparently
> that doesn't work -- this file doesn't produce the desired output of
> reproducing the last warning ...
> 
> ========================
> \documentclass{article}

Missing \begin{document}
 
> Test {\tt last.warning}
> 
> <<>>=
> x <- log(-1)
> L <- last.warning
> @
> 
> <<>>=
> L
> @
> 
> \end{document}
> ==================

No real answer, but I inserted a 

print(exits("last.warning")) 

which gives FALSE when sweaved, but TRUE when the tangled R file is run.


Dieter




More information about the R-help mailing list