Learn R Programming

arules (version 1.0-12)

combine: Combining Objects

Description

Provides the S4 methods to combine several objects based on itemMatrix into a single object. Note, use union rather than c to combine several mined itemsets (or rules) into a single set.

Usage

## S3 method for class 'itemMatrix':
c(x, ..., recursive = FALSE)

## S3 method for class 'transactions': c(x, ..., recursive = FALSE)

## S3 method for class 'rules': c(x, ..., recursive = FALSE)

## S3 method for class 'itemsets': c(x, ..., recursive = FALSE)

Arguments

x
first object.
...
further objects of the same class as x to be combined.
recursive
a logical. If recursive=TRUE, the function recursively descends through lists combining all their elements into a vector.

Value

  • An object of the same class as x.

See Also

itemMatrix-class, transactions-class, rules-class, itemsets-class

Examples

Run this code
data("Adult")

## combine transactions
a1 <- Adult[1:10]
a2 <- Adult[101:110]

aComb <- c(a1, a2)
summary(aComb)

## combine rules
r1 <- apriori(Adult[1:1000])
r2 <- apriori(Adult[1001:2000])
rComb <- unique(c(r1, r2)) 
rComb

Run the code above in your browser using DataLab