Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unique

Remove Duplicated Elements from a Collection


Description

Provides the generic function unique and the S4 methods for itemMatrix. unique uses duplicated to return an itemMatrix with the duplicate elements removed.

Note that unique can also be used on collections of associations.

Usage

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

Arguments

x

an object of class itemMatrix or associations.

...

further arguments (currently unused).

incomparables

currently unused.

Value

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

Author(s)

Michael Hahsler

See Also

Examples

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

arules

Mining Association Rules and Frequent Itemsets

v1.6-7
GPL-3
Authors
Michael Hahsler [aut, cre, cph], Christian Buchta [aut, cph], Bettina Gruen [aut, cph], Kurt Hornik [aut, cph], Ian Johnson [ctb, cph], Christian Borgelt [ctb, cph]
Initial release
2021-03-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.