From Bill Simpson <wsi@gcal.ac.uk>  Tue May 11 15:51:23 1999
From: Bill Simpson <wsi@gcal.ac.uk> (Bill Simpson)
Date: Tue, 11 May 1999 14:51:23 +0000 (GMT)
Subject: matrix() can't handle NaN (PR#193)
In-Reply-To: <Pine.SUN.3.91.990511092658.11064E-100000@paca>
Message-ID: <Pine.LNX.3.96.990511144151.8662B-100000@cbe207.gcal.ac.uk>



On Tue, 11 May 1999, Ben Bolker wrote:
>   One *could* extend the default na.strings in read.table to 
> c("NA","NaN"), which would take care of the immediate problem but might 
> further blur the subtle distinction between NA and NaN.  I don't know 
> how/whether one would want to extend read.table() to deal with Inf/-Inf 
> in data files ... (I think not).

My attitude is that if NaN is a recognized "number" by the numerical
analysts (the guys who write the floating point standards), why not treat
it as such throughout R? But maybe this opens a can of worms.

In my example, I was expecting to have the z matrix for an image plot with
NaNs in it. Then I was going to convert them either to zeros or NAs prior
to making the plot.

I would put the onus on the user to deal with the NaNs prior to
passing the data onto some other function. I would not favour some
automatic conversion of NaN into NA.

Bill

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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