[R] Stderr

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Apr 10 11:20:51 CEST 2008



Patricia García wrote:
> Hi everyone,
> 
> I need to get an error message as an object in the std output console. I can
> get it as a file with the following instructions:
> 
> # Save error mesage:
>     error1  <-  file("error1.txt", open="wt")
>     sink(error1, type="message")
>     experiment <- function(data)
> 
> 
> With this, the error messages get saved in the file, but i need them as
> object in order to work with it in the console.


I'm not sure what you are going to do, note that the last line contains 
an incomplete statement...

If you want an object: you already have got the object error1 ...

If you want error handling facilities, see ?try and its "See Also" section.


Uwe Ligges


> Is it possible?
> Thanks
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list