John,
You've given me exactly what I'm looking for. Thank you.
By the way, index into nub is not required. It is the job of the metrics to
categorize the aspects. Now my code looks like this:
aspects =: }. <@:>"1 |: }. > cut &.> LF cut data
aspects
+-----+----+--+-+------+
|5'10"|170#|34|M|Black |
|5'10"|190#|25|M|Black |
|5'3" |110#|23|F|Blonde|
|6'1" |210#|37|M|Blonde|
+-----+----+--+-+------+
height =. 6 s: s:
weight =. 0 "."0 {."1 NB. Weight, first digit
age =. 0 "."0 {."1 NB. Age, decade
sex =. 'M' = , NB. Are you a man, or a ...
hair =. 6 s: s:
metrics =. height`weight`age`sex`hair
buckets =: ,/ 1 metrics@>;.1 aspects
buckets
1 1 2 3
1 1 1 2
3 2 2 3
1 1 0 1
4 4 5 5
jjss -: (<@:(</.)"1 i.@:{:@:$) buckets NB. Isomorphic
representation
1
Thanks again! (To Roger and Oleg, too)
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm