Skip to content
Prev 35466 / 63421 Next

Benefit of treating NA and NaN differently for numerics

On 31/12/2009 3:43 PM, Saptarshi Guha wrote:
I don't know of any cases where a useful distinction is made between NA 
and NaN, but I suppose it could be useful to know where the bad value 
came from.  R functions rarely generate NaN directly, it usually comes 
from the hardware or runtime library.

And by the way, as the thread containing this message shows,

http://finzi.psych.upenn.edu/R/R-devel/2009-August/054319.html

there are several different encodings which are displayed as NA, and a 
huge number (more than 2^50, I seem to recall) of different encodings 
displayed as NaN.

Duncan Murdoch