

   sets {base}                                  R Documentation

   SSeett OOppeerraattiioonnss

   DDeessccrriippttiioonn::

        Performs set union, intersection difference and member-
        ship on two vectors.

   UUssaaggee::

        union(x, y)
        intersect(x, y)
        setdiff(x, y)
        is.element(x, y)

   AArrgguummeennttss::

       x, y: vectors (of the same type) contain a sequence of
             items with no       duplicated values.

   DDeettaaiillss::

        Each of `union', `intersect' and `setdiff' will remove
        any duplicated values in the arguments.

   VVaalluuee::

        A vector of the same type as `y'.

   AAuutthhoorr((ss))::

        B. D. Ripley

   EExxaammpplleess::

        x <- sample(1:20, 10)
        y <- sample(3:23, 7)
        union(x, y)
        intersect(x, y)
        setdiff(x, y)
        is.element(y, x)

