Re: [R] How to suppress the printing of warnings (Windows)?

From: Prof Brian Ripley <>
Date: Mon 11 Apr 2005 - 22:47:55 EST

On Mon, 11 Apr 2005, Jacho-Chavez,DT (pgr) wrote:

> Dear all,
> I'm a newbie in R. I am running simulations using a fixed bandwidth in
> nonparametric regressions, sending all the output to a file myoutput.txt
> using sink("myoutput.txt"), & R is printing all warnings by the end of
> the simulation on the file. I know the source of the problem & can take
> care of it. However, finding a 50 MB file (where all the output is
> printed, e.g. myoutput.txt) by the end of the simulation exercise is not
> quite pleasant. How could I turn them off completely?, so they are not
> printed in myoutput.txt file.


However, warnings and errors are sent to stderr not stdout except on obselete versions (95/98/ME) of Windows, and so not redirected by that sink() call. For me (Windows XP)

> sink("foo.out")
> warning("test")
Warning message:

as expected. So is this an obsolete version of Windows or a very old version of R?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Apr 12 11:08:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:07 EST