Jacho-Chavez,DT (pgr)
2005-Apr-11 12:14 UTC
[R] How to suppress the printing of warnings (Windows)?
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. Thanks in advanced for your help. David
Dimitris Rizopoulos
2005-Apr-11 12:26 UTC
[R] How to suppress the printing of warnings (Windows)?
try, options(warn=-1) I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Jacho-Chavez,DT (pgr)" <D.T.Jacho-Chavez at lse.ac.uk> To: <r-help at stat.math.ethz.ch> Sent: Monday, April 11, 2005 2:14 PM Subject: [R] How to suppress the printing of warnings (Windows)?> 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. > > Thanks in advanced for your help. > > > David > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >
> 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.Look at ?options and scroll to 'warn.' Also, ?warnings gives an example. HTH, Andy
Prof Brian Ripley
2005-Apr-11 12:47 UTC
[R] How to suppress the printing of warnings (Windows)?
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.options(warn=-1) 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: test as expected. So is this an obsolete version of Windows or a very old version of R? -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Jacho-Chavez,DT (pgr)
2005-Apr-11 13:03 UTC
[R] How to suppress the printing of warnings (Windows)?
I'm running R v2.0.0 on Windows 2000. The command options(warn=-1) did the trick. However, is there a way I may also stop these warnings from printing on my screen while using R interactively. I am working with the LOCFIT library. I'm also planning to run my simulations in my department's Unix machine (R v1.9.0) in batch mode, would `option(warn=-1)' do the trick there as well? David -----Original Message----- From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] Sent: 11 April 2005 13:48 To: Jacho-Chavez,DT (pgr) Cc: r-help at stat.math.ethz.ch Subject: Re: [R] How to suppress the printing of warnings (Windows)? 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.options(warn=-1) 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: test as expected. So is this an obsolete version of Windows or a very old version of R? -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595