NA is a value that you can use for "missing" or inapplicable. It is also the value returned by R functions to indicate missing (e.g. if you use the match function to search a vector for a particular value, but the value isn't present, match will return NA).
NaN means that the value wasn't missing but can't be expressed as a number. 0/0 is NaN because the result is mathematically undefined (sometimes called 'indeterminate'). Does that help at all ? Michael On 17 August 2010 16:59, Stephen Liu <[email protected]> wrote: > Hi folks, > > > Could you please help me to understand; > > > An Introduction to R > http://cran.r-project.org/doc/manuals/R-intro.html#Logical-vectors > > > The function is.na(x) gives a logical vector of the same size as x with value > TRUE if and only if the corresponding element in x is NA. > > > z <- c(1:3,NA); ind <- is.na(z) > > and > > > Note that there is a second kind of “missing” values which are produced by > numerical computation, the so-called Not a Number, NaN, values. Examples are > > > 0/0 > > or > > > Inf - Inf > > > the explanation being abstract to me to understand. TIA > > > B.R. > Stephen L > > > > ______________________________________________ > [email protected] 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. > ______________________________________________ [email protected] 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.

