From p.dalgaard@biostat.ku.dk  Fri Apr  9 10:04:45 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 09 Apr 1999 11:04:45 +0200
Subject: a strange logical bug (PR#162)
In-Reply-To: Ross Ihaka's message of "Fri, 9 Apr 1999 19:30:09 +1200 (NZST)"
References: <Pine.BSF.3.96.990409192859.3007C-100000@g.ihaka.slip.auckland.ac.nz>
Message-ID: <x2g16a411u.fsf@blueberry.kubism.ku.dk>

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


a strange logical bug (PR#162)
Peter Dalgaard BSA