[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: handling NaN

From: Paul Kienzle
Subject: Re: handling NaN
Date: Thu, 8 Aug 2002 15:02:23 -0400

On Thu, Aug 08, 2002 at 11:39:38AM -0500, John W. Eaton wrote:
> On  8-Aug-2002, Paul Kienzle <address@hidden> wrote:
> | One suggestion is to define a constant NA to represent missing values.  
> These
> | could then be ignored in all the stats functions.  I believe this would work
> | well enough, except for the people coming from matlab who want to use NaN to
> | represent missing values.
> So, how about adding an R-compatible NA value to Octave?  

The only compatibility issue for running matlab code in octave will still be 
handling of NaN values in the min/max functions right?  [For these, we can
mechanically substitute nanmin/nanmax for min/max.]

Running octave code in matlab which relies on NA will be more difficult.

> I have a
> patch that does this for doubles, but that's probably all that is
> needed since most things in Octave are done on doubles anyway, right?
> I know that R has an NA_INTEGER value (at least internally) that is
> currently represented by INT_MIN, but to me, that seems like a less
> reliable thing to do, so I'd rather not if we don't need it.

Since we don't have integers, we don't need NA_INTEGER.  The only
compelling reason I can see for adding integers would be if they 
were 8 bit integers so that we use them to represent large images.

>   octave:7> x = rand (3); x(2,2) = NA; is_NA (x)

I hate having to remember if it is "is_condition" or "iscondition".  Could
we please use "iscondition" for all new tests?  In this case, isNA, or
better yet, isna.

> Now all that's left is to fix various functions to be NA-aware.  This
> will take some time, and it would help if someone (or some group)
> could volunteer to help out with that.
> Thanks,
> jwe

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]