NetLogo 7.0.0-beta2:

table:group-agents

table:group-agents agentset anonymous reporter

Groups the agents in the agentset based on the given reporter. Agents that report the same thing for reporter will be grouped together. The results of the reporter will be used as the keys in the resulting table and the groups will be agentsets.

For example:

observer> create-turtles 100 [ set color one-of [ red green blue ] ]
observer> show table:group-agents turtles [ color ]
observer: {{table: [[105 (agentset, 38 turtles)] [55 (agentset, 32 turtles)] [15 (agentset, 30 turtles)]]}}

Take me to the full Table Extension Dictionary