[R] Basic question on function

Gabor Grothendieck ggrothendieck at myway.com
Sat Dec 13 15:07:36 CET 2003



In that particular case there is also 

which.max(x)

--- 
Date: Sat, 13 Dec 2003 13:31:42 -0000 (GMT) 
From: <Ted.Harding at nessie.mcc.ac.uk>
To: Martin Maechler <maechler at stat.math.ethz.ch> 
Cc: <R-help at stat.math.ethz.ch> 
Subject: Re: [R] Basic question on function "identical" 

 
 
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