s-news
[Top] [All Lists]

Re: tracking down warnings message

To: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
Subject: Re: tracking down warnings message
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Wed, 28 Jul 2004 21:54:22 +0100 (BST)
Cc: "Leeds, Mark" <mleeds@mlp.com>, <s-news@lists.biostat.wustl.edu>
In-reply-to: <41080FEA.7040301@pdf.com>
options(warn = 1) or options(warn = 2) can help tracking these down.
I would set options(warn=2) and force an error dump, then use debugger.

On Wed, 28 Jul 2004, Sundar Dorai-Raj wrote:

> Leeds, Mark wrote:
> 
> > i have a pretty complex program that
> > calls a library that i built that has functions in it.
> > the program runs correctly but then
> > at the end of it, i get warnings.
> >  
> > the message is repeated
> > 50 times and is
> >  
> >  
> > 1: Condition has 2 elements : only the first used in : if ( smax < s)
> > smax <- s
> > 2 ditto
> >  
> 
> `if' is not a vectorised function yet you supplied a vector to it. The 
> warning implies `smax < s' is a vector of length 2. Perhaps you want 
> something like
> 
> if(all(smax < s))
> 
> or
> 
> if(any(smax < s))
> 
> However if you are not expecting smax and/or s to have length greater 
> than one, then you need to investigate how these objects are created.

-- 
Brian D. Ripley,                  ripley@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


<Prev in Thread] Current Thread [Next in Thread>