[R] Basic question on function "identical"

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Sat Dec 13 14:31:42 CET 2003


On 13-Dec-03 Martin Maechler wrote:
> In general, use
> 
>   ==       for testing equality of integer numbers (of type "integer"
>            or not)

I hope this is not a suggestion to avoid usage like

  which(x == max(x))

when x is a vector of reals? (i.e. should be OK when you know that
the thing on one side of == should be an exact copy in its internal
representation of the thing on the other side, if equality in the
usual sense holds).

In other words, I hope that (for instance) max(x) does not differ
internally from whichever of x[1] , ... , x[N] has the largest value ...

>   all.equal  for testing (near)equality non-integer numbers, and
>            many other more structured objects.
> 
>   identical  only if you understand more about the S language ;-)

Cheers,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 13-Dec-03                                       Time: 13:31:42
------------------------------ XFMail ------------------------------




More information about the R-help mailing list