Topic: APLX Help : Help on APL language : APL Primitives : ∪ Unique
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

Unique


One-argument form  See also two-argument form Union

Unique is used to remove duplicated items from a vector. The result is a vector containing all the unique items in the argument, in the order in which they first appear. The argument must be a vector (or scalar).

When the argument is nested, an exact match in data and structure must be found before an item is removed as a duplicate. This operation is affected by ⎕CT, the comparison tolerance.

       ∪'THE QUALITY OF MERCY IS NOT STRAINED'
THE QUALIYOFMRCSND

      ∪1 4 17 23 12 4 2 7 99 33 ¯1 4 17 99 100 101
1 4 17 23 12 2 7 99 33 ¯1 100 101

      ∪'THIS' 'THAT' 'THE' 'OTHER' 'OTHER' 'THAN' 'THIS' 'AND' 'THAT'
 THIS THAT THE OTHER THAN AND

See also the other 'set' operations: Union, Intersection and ~ Without .


Topic: APLX Help : Help on APL language : APL Primitives : ∪ Unique
[ Previous | Next | Contents | Index | APL Home ]