## · Union

Two-argument form See also one-argument form Unique

Union returns all items which can be found in both the left and right arguments. The right argument can be of any shape or rank. The left argument must be a scalar or vector. The result is always a vector.

The result first contains all the items in the left argument (in the order in which they appear), followed by all the items found in the right argument but not in the left argument. If a particular item appears more than once in the left argument, it will also appear more than once in the result. Equally, if a particular item does not appear in the left argument, but does appear multiple times in the right argument, it will appear multiple times in the result.

This operation is affected by ▄CT, the comparison tolerance.

           'THE QUALITY OF MERCY IS NOT STRAINED'·'HIP HOP DOWN TO THE ZOO'
    THE QUALITY OF MERCY IS NOT STRAINEDPPWZ

          1 4 17 23 12 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

          ▄display (23 43 21) (╪5) (2 2Ґ'BLOT') · (╪5) ('BLOT')
    з┘нннннннннннннннннннннннннннннннннннл
    ш з┘нннннннл з┘ннннннннл з┘нл з┘нннл ш
    ш ш23 43 21ш ш1 2 3 4 5ш ┤BLш шBLOTш ш
    ш ю~ннннннны ю~нннннннны шOTш юнннны ш
    ш                        юнны        ш
    ю╧ннннннннннннннннннннннннннннннннннны

See also the other 'set' operations: · Unique, ~ Without and ² Intersection.

Topic: APLX Help : Help on APL language : APL Primitives : · Union

[ Previous | Next | Contents | Index ]