# setOperations

0th

Percentile

##### Set Operations

Provides the generic functions and the S4 methods for the set operations union, intersect, setequal, setdiff and is.element on sets of associations (e.g., rules, itemsets) and itemMatrix.

Keywords
manip
##### Usage
union(x, y)
intersect(x, y)
setequal(x, y)
setdiff(x, y)
is.element(el, set)
##### Arguments
x,y, el, set

sets of associations or itemMatrix objects.

##### Details

All S4 methods for set operations are defined for the class name "ANY" in the signature, so they should work for all S4 classes for which the following methods are available: match, length and unique.

##### Value

union, intersect, setequal and setdiff return an object of the same class as x and y.

is.element returns a logic vector of length el indicating for each element if it is included in set.

associations-class, itemMatrix-class

##### Aliases
• setOperations
• sets
• union
• union-methods
• union,associations,associations-method
• union,itemMatrix,itemMatrix-method
• intersect
• intersect-methods
• intersect,associations,associations-method
• intersect,itemMatrix,itemMatrix-method
• setequal
• setequal-methods
• setequal,associations,associations-method
• setequal,itemMatrix,itemMatrix-method
• setdiff
• setdiff-methods
• setdiff,associations,associations-method
• setdiff,itemMatrix,itemMatrix-method
• is.element
• is.element-methods
• is.element,associations,associations-method
• is.element,itemMatrix,itemMatrix-method
##### Examples
# NOT RUN {

## mine some rules

## take 2 subsets
r1 <- r[1:10]
r2 <- r[6:15]

union(r1,r2)
intersect(r1,r2)
setequal(r1,r2)
# }

Documentation reproduced from package arules, version 1.5-5, License: GPL-3

### Community examples

Looks like there are no examples yet.