| match {arules} | R Documentation |
Provides the generic function match
and the S4 methods for associations and transactions.
match returns a vector of the positions of (first) matches of
its first argument in its second.
match(x, table, nomatch = NA, incomparables = FALSE)
x |
an object of class itemMatrix, transactions or associations. |
table |
a set of associations or transactions to be matched against. |
nomatch |
the value to be returned in the case when no match is found. |
incomparables |
not implemented. |
An integer vector of the same length as x giving the position in
table of the
first match if there is a match, otherwise nomatch.
unique,
duplicated,
rules-class,
itemsets-class,
itemMatrix-class
data("Adult")
### get unique transactions
vals <- unique(Adult)
### count frequency
cnts <- tabulate(match(Adult, vals))
### plot frequency counts
plot(sort(cnts, decreasing=TRUE))