[Rd] NA and NaN in function identical

From: Petr Savicky <savicky_at_cs.cas.cz>
Date: Wed, 29 Aug 2007 15:53:27 +0200


The help page for function identical says:

'identical' sees 'NaN' as different from 'as.double(NA)', but all
'NaN's are equal (and all 'NA' of the same type are equal).
However, we have
  x <- NaN
  y <- as.double(NA)
  x # [1] NaN
  y # [1] NA
  identical(x,y) # [1] TRUE

In my opinion, NaN and as.double(NA) should be distinguished as the help page suggests.

Tested under R version 2.5.1 Patched (2007-08-19 r42638) on Linux (CPU Xeon).

Petr Savicky.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 29 Aug 2007 - 13:56:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 30 Aug 2007 - 11:39:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.