> Alternatively, amalgamation works fine, though you probably want to
> amalgamate with vector instead of str. That prevents inadvertent
> collisions in cases where the elements in are similar (not a problem
> for you). Again, assuming appropriate definitions for M and F:
>
> {[1 M] [ 1 2 3 4 5 6 7 8 9],
> [1 F] [ 2 4 5 6607 43 54 234],
> [2 M] [ 1 2 3 4 5 6 7 8 44 6 23 44],
> [2 F] [ 2 4 6 8 10 12 17 38 55],
> [3 M] [ 1 2 3 4],
> [3 F] [ 2 4 6 8 33 45 10 12]})
>
> And access looks like (data [4 M]).
>
If your data is in an incanter.dataset, then you can use the $group-by
function to get the above map (keyed with vectors of Cat and Gender),
like so:
($group-by [:Cat :Gender] data)
David
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en