Learn R Programming

arules (version 1.7-8)

unique: Remove Duplicated Elements from a Collection

Description

Provides the generic function unique() and the methods for itemMatrix transactions, and associations.

Usage

unique(x, incomparables = FALSE, ...)

# S4 method for itemMatrix unique(x, incomparables = FALSE)

# S4 method for associations unique(x, incomparables = FALSE, ...)

Value

An object of the same class as x with duplicated elements removed.

Arguments

x

an object of class itemMatrix or associations.

incomparables

currently unused.

...

further arguments (currently unused).

Author

Michael Hahsler

Details

unique() uses duplicated() to return an object with the duplicate elements removed.

See Also

Other associations functions: abbreviate(), associations-class, c(), duplicated(), extract, inspect(), is.closed(), is.generator(), is.maximal(), is.redundant(), is.significant(), is.superset(), itemsets-class, match(), rules-class, sample(), sets, size(), sort()

Other itemMatrix and transactions functions: abbreviate(), c(), crossTable(), duplicated(), extract, hierarchy, image(), inspect(), is.superset(), itemFrequency(), itemFrequencyPlot(), itemMatrix-class, match(), merge(), random.transactions(), sample(), sets, size(), supportingTransactions(), tidLists-class, transactions-class

Examples

Run this code
data("Adult")

r1 <- apriori(Adult[1:1000], parameter = list(support = 0.5))
r2 <- apriori(Adult[1001:2000], parameter = list(support = 0.5))

## Note that this produces a collection of rules from two sets
r_comb <- c(r1, r2)
r_comb <- unique(r_comb)
r_comb

Run the code above in your browser using DataLab