jmp-l
[Top] [All Lists]

beware of RANK() behaviour

To: <jmp-l@lists.biostat.wustl.edu>
Subject: beware of RANK() behaviour
From: <Gunter.Hartel@csl.com.au>
Date: Tue, 19 Sep 2006 09:49:14 +1000
Thread-index: AcbbfQvEkUwBgbOLQ1SezgXWVxv3ag==
Thread-topic: beware of RANK() behaviour

Hi,

I just noted what I consider odd behaviour in the RANK() function.

The rank function is supposed to be used on vectors rather than lists. When used on lists it doesnt complain but just returns a wrong result:

a = {5, 4, 1, 2, 3};

rank(a);

[5,4,3,2,1]

a = [5 4 1 2 3];

rank(a);

[3,4,5,2,1]

Perhaps the way the rank() function deals with lists is useful under some circumstances, but in general I prefer when functions complain when theyre given the wrong type of parameter rather than produce a non-sense result that can be hard to track down.

Cheers

Gunter

 

***************************************************************************************************************

 

This email and any attachments are confidential and may be subject to legal or other professional privilege. Any confidentiality or privilege is not waived or lost because this email has been sent to you by mistake. You should not read, copy, adapt, use or disclose them or their contents without authorisation. Any personal information in this email must be handled in accordance with the Privacy Act 1988 (Cth).

If you are not an intended recipient, please contact us at once by return email and then delete both messages.

 

 

CSL Limited A.C.N. 051 588 348

45 Poplar Road Parkville Victoria 3052 Australia

Phone: +61 3 9389 1911 Fax: +61 3 9389 1434

***************************************************************************************************************

 

<Prev in Thread] Current Thread [Next in Thread>
  • beware of RANK() behaviour, Gunter.Hartel <=