[R] Infinite != NaN?
jm_hannon at yahoo.com
Sun Aug 30 03:58:44 CEST 2009
Greetings. I somehow had the impression that an infinite number, as obtained by dividing by zero, for instance, would be flagged as both missing ("NA") and not a number ("NaN"). It appears that I was wrong on both counts, although the is.finite function correctly returns FALSE in such a case. Please see the appended for some details. I guess that the bottom line is that R works the way it works, but if you can add anything that will further instruct me, I'd appreciate it.
> y <- 2/0
> z <- log(-1)
In log(-1) : NaNs produced
R version 2.9.2 (2009-08-24)
Copyright (C) 2009 The R Foundation for Statistical Computing
$ uname -a
Linux xxxxxxx.localdomain 184.108.40.206-217.2.16.fc11.x86_64 #1 SMP Mon Aug 24 17:17:40 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
More information about the R-help