help-octave
[Top][All Lists]
Advanced

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

Re: Difference between NaN and NA?


From: CdeMills
Subject: Re: Difference between NaN and NA?
Date: Thu, 8 Apr 2010 08:05:03 -0800 (PST)


John W. Eaton wrote:
> 
> 
> Right, I added this feature to Octave specifically for compatibility
> with NA in R.  The idea was to be able to exchange binary data with R
> and preserve the special NaN value that R uses for NA.
> 
> | In the current situation, NA's do no harm in Octave, but they're also
> | not much useful, because most functions ignore them, for instance,
> | mean ([1,2,3,NA]) is NA etc.
> | On the contrary, inserting checks for NA's everywhere is a good idea
> | either, because it will slow things down for everyone.
> 
> Yes, I assume R has a lot of special checks for NA (and that you meant
> "is not a good idea".  Un?fortunately, no one was ever motivated to
> make Octave functions NA-aware.  So the value exists, but it is not
> really used for anything.
> 
> Also, there is no guarantee that NA will be preserved across a
> function call.  For example, on some platforms, you might see
> something like
> 

'NA' is an heritage of SQL. It is mostly used in statistical context, to
compute f.i. degrees of freedom, the number of available data. By default,
in R, everything touching NA becomes NA, except if the flag na.rm is set to
true. So, about performances, this adds a logical test at the functions
start, is this a performance issue ?

Regards

Pascal
--

-- 
View this message in context: 
http://n4.nabble.com/Difference-between-NaN-and-NA-tp1756346p1774299.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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