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

Reply via email to