It works great, and in a few seconds less. Thanks! Jordan
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Raul Miller Sent: Friday, November 13, 2009 2:34 PM To: Programming forum Subject: Re: [Jprogramming] rank by a key On Fri, Nov 13, 2009 at 1:10 PM, Tirrell, Jordan (Consultant) > key=: 1 1,1 0,1 1,1 0,1 0,0 1,:1 1 > data=: 0 1,1 1,0 2,0 2,2 0,0 0,:1 1 > key rankbykey1 data > 2 1 1 2 0 0 0 > key rankbykey2 data > 2 1 1 2 0 0 0 > > I cannot figure out how to use ~: to express this function as Raul > Miller suggested, does anyone see a specific solution using it? Perhaps something like this would work for you? rankbykey3=: (/:@/:@(i.~ ~.)@[ { [:; <@(i.~ \:~)/.) Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
