Gather

Gather[list]
gathers the elements of list into sublists of identical elements.

Gather[list,test]
applies test to pairs of elements to determine if they should be considered identical.

DetailsDetails

  • The default function used to test whether elements are identical is SameQ.
  • Gather[{e1,e2,},p] will gather together elements for which returns True.
Introduced in 2008
(7.0)