[R] catching the warnings

Roger D. Peng rpeng at jhsph.edu
Thu Jun 3 14:43:05 CEST 2004


The warnings are stored in a variable `last.warning' in the workspace. 
  warnings() simply prints this variable.

-roger

Marc Mamin wrote:
> Hello,
> 
> I'd like to catch the warnings in a variable in order to evaluate them, but...
> 
> 
> 
>>tt<-warnings()
> 
> Warning messages:
> 1: XML Parsing Error: test.xml:2: xmlParseStartTag: invalid element name
> 2: XML Parsing Error: test.xml:3: Extra content at the end of the document
> 
>>tt
> 
> NULL
> 
> is there a way to achieve this (R1.8.1)?
> 
> thanks,
> 
> Marc
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list