In R0.64.0, try as.numeric(is.na(c(NA,NA,1))) as.numeric(c(T,T,F)) Jim -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 9 Apr 1999 jlindsey@alpha.luc.ac.be wrote:> In R0.64.0, try > as.numeric(is.na(c(NA,NA,1))) > as.numeric(c(T,T,F))My version says > as.numeric(is.na(c(NA,NA,1))) [1] 1 1 0 > as.numeric(c(T,T,F)) [1] 1 1 0 which I think is ok? Ross -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 9 Apr 1999 jlindsey@alpha.luc.ac.be wrote:> In R0.64.0, try > as.numeric(is.na(c(NA,NA,1))) > as.numeric(c(T,T,F))My version says > as.numeric(is.na(c(NA,NA,1))) [1] 1 1 0 > as.numeric(c(T,T,F)) [1] 1 1 0 which I think is ok? Ross -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Ross Ihaka <ihaka@stat.auckland.ac.nz> writes:> On Fri, 9 Apr 1999 jlindsey@alpha.luc.ac.be wrote: > > > In R0.64.0, try > > as.numeric(is.na(c(NA,NA,1))) > > as.numeric(c(T,T,F)) > > My version says > > > as.numeric(is.na(c(NA,NA,1))) > [1] 1 1 0 > > as.numeric(c(T,T,F)) > [1] 1 1 0 > > which I think is ok?Mine has> as.numeric(is.na(c(NA,NA,1)))[1] -1 -1 0 Which is obviously not OK... Seems to affect all numeric NA's:> as.numeric(is.na(as.numeric(NA)))[1] -1 This is on RedHat 5.2 (As Jim, I suspect) Ick! -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> Mine has > > > as.numeric(is.na(c(NA,NA,1))) > [1] -1 -1 0 > > Which is obviously not OK... > > Seems to affect all numeric NA's: > > > A))) > [1] -1 > > This is on RedHat 5.2 (As Jim, I suspect)On RH 5.2 The isnan() function returns a non-zero value if value is "not-a-number" (NaN), and 0 otherwise. and that non-zero is not defined! On Solaris: isnan(), isnand(), and isnanf() return true (1) if the argu- ment dsrc or fsrc is a NaN; otherwise they return false (0). and isnan is used in Arith.c for ISNAN and that is used in coerce.c for do_isna (why?) So ISNAN needs to be redefined on Linux at least. Using ISNA not ISNAN solves this one for me. Brian -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk writes:> On RH 5.2 > > The isnan() function returns a non-zero value if value is > "not-a-number" (NaN), and 0 otherwise. > > and that non-zero is not defined!Uh-oh...> and isnan is used in Arith.c for ISNAN and that is used in coerce.c > for do_isna (why?)is.na(0/0) # Splus compat.> So ISNAN needs to be redefined on Linux at least. Using ISNA not ISNAN > solves this one for me.But...(see above) A better fix is #define ISNAN(x) (isnan(x)!=0) Next problem: Messing with Arith.h and make'ing doesn't do anything (dependency missing, obviously) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 9 Apr 1999 ripley@stats.ox.ac.uk wrote:> > > as.numeric(is.na(c(NA,NA,1))) > > [1] -1 -1 0 > > > > Seems to affect all numeric NA's: > > > > > A))) > > [1] -1 > > > > This is on RedHat 5.2 (As Jim, I suspect) > > On RH 5.2I don't seem to have this problem on Debian 2.2 (with glibc2.1):> as.numeric(is.na(as.numeric(NA)))[1] 1> as.numeric(is.na(c(NA,NA,1)))[1] 1 1 0 Nicholas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:PD> ripley@stats.ox.ac.uk writes: >> On RH 5.2 >> >> The isnan() function returns a non-zero value if value is >> "not-a-number" (NaN), and 0 otherwise. >> >> and that non-zero is not defined! PD> Uh-oh... >> and isnan is used in Arith.c for ISNAN and that is used in coerce.c >> for do_isna (why?) PD> is.na(0/0) # Splus compat. >> So ISNAN needs to be redefined on Linux at least. Using ISNA not >> ISNAN solves this one for me. PD> But...(see above) PD> A better fix is PD> #define ISNAN(x) (isnan(x)!=0) oh dear; and we had thought we would clean up the ISNAN definition and do_isna[n] functions.... Are we all sure that this is *IT* for now... Could we improve on the tests in configure.in to make sure beforehand that ISNAN will work? PD> Next problem: Messing with Arith.h and make'ing doesn't do anything PD> (dependency missing, obviously) I've added ``a few of these'' to src/appl/Makefile.in and src/nmath/Makefile.in -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I believe I am being bitten by the isna bug and will happily wait until it is fixed before I check further. However, one message seemed to suggest this may only be a problem in Linux, and I am running Solaris. If more detailed problem reports on this would be useful will someone please let me know. Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 9 Apr 1999, Paul Gilbert wrote:> I believe I am being bitten by the isna bug and will happily wait until it is > fixed before I check further. However, one message seemed to suggest this may > only be a problem in Linux, and I am running Solaris. If more detailed problem > reports on this would be useful will someone please let me know.It is not a problem on Solaris, just on some Linux dialects where isnan is no fully defined. The fix is in R-release now: please check a snapshot after tomorrow, then let us know about your isna bug! -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._