Skip to content
Prev 2150 / 63424 Next

matrix() can't handle NaN (PR#193)

On Tue, 11 May 1999, Prof Brian Ripley wrote:

            
That's why I said that NaN was a "number" (with quotes). It is a number in
the sense that it is the output of an arithmetic operation.
Yes.
Oh.
Well to me NA means missing value, and it is abuse of NA to use it to
represent things like 0/0.

The purpose of having NaN to me:
I am allowed to get an NaN as a result of some operation in R. Let's say I
then save that in a file, then I read the file in again using read.table.
In the process of saving and reading it in I lose the NaN. I don't like
that. It doesn't seem consistent. If the NaN is to be changed, I would
like to do the changing explicitly myself, so I know what happened to it.

I would also include Inf and -Inf here. These are allowed outputs from R
operations, so why can't they be read in by read.table? So I am proposing
that allowable IEEE entities Inf, -Inf, NaN be read in by read.table as
themselves (not as character strings).
OK I see this point. That's what I meant when I said maybe it would be
opening a can of worms to try to use NaN and Inf consistently throughout
R.

Bill

PS: I remember reading on this list about complex numbers in R. That
brings in a conflict with IEEE (doesn't it?), because in IEEE,
sqrt(negative number)->NaN.
But that is not a NaN if you allow complex numbers (I would think).
Warning: NaNs produced in function "sqrt"
[1] NaN

Is there a need for an "I" symbol in R?

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._