[R] ignore warning messages?

Hua Li hualihua at yahoo.com
Mon Jul 7 01:26:48 CEST 2008


Thanks a lot, Henrique and Jorge!


--- On Tue, 7/1/08, Jorge Ivan Velez <jorgeivanvelez at gmail.com> wrote:

> From: Jorge Ivan Velez <jorgeivanvelez at gmail.com>
> Subject: Re: [R] ignore warning messages?
> To: hualihua at yahoo.com
> Cc: "R-help" <r-help at r-project.org>
> Date: Tuesday, July 1, 2008, 1:12 PM
> Dear Hua,
> 
> Try
> 
> options(warn=-1)
> tt = "test"
> as.numeric(tt)
> [1] NA
> 
> 
> See also ?options for more info.
> 
> HTH,
> 
> Jorge
> 
> 
> On Tue, Jul 1, 2008 at 12:11 PM, Hua Li
> <hualihua at yahoo.com> wrote:
> 
> > Hi All,
> >
> > I'm working with R and want to ignore the warning
> messages given, is there
> > a way to stop R from giving out warning messages any
> more?
> >
> > an example:
> >
> > tt = "test"
> > as.numeric(tt)
> >
> > would give me the following message:
> >
> > [1] NA
> > Warning message:
> > NAs introduced by coercion
> >
> > I decide to ignore the warning message for now and
> don't want it to show
> > any more, can someone help?
> >
> > Thanks!
> >
> >
> > Hua
> >
> > ______________________________________________
> > 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