You did not provide a j expression to generate
your data, so I had to improvise:
names=:;:'alpha beta delta gamma omega'
col1=: ,.names {~ (# i...@#)3 1 4 2 1
col2=: 3 14 7 73 21 15 6 33 5 17 37
t1=: col1 ,. ]&.> col2
Once I have the data, here is how I would
generate your result:
(~...@[ ,. +&.>//.)/ |:t1
+-----+--+
|alpha|24|
+-----+--+
|beta |73|
+-----+--+
|delta|75|
+-----+--+
|gamma|22|
+-----+--+
|omega|37|
+-----+--+
First off, I prefer columns of tables to be items of my
array.
Second, once I have a two item list, I can use / to
insert whatever verb I like between the two items.
Finally, ~. will give me my labels, if I apply it
to the first column, and +&.>/ will sum numbers
in boxes, and /. will arrange so that my labels
organize my data.
I hope my explanation is clear enough -- if not, and
if the relevant dictionary entries do not clear things
up for you, just ask.
FYI,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm