match {arules}R Documentation

Value Matching

Description

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.

Usage

match(x,  table, nomatch = NA, incomparables = FALSE)

Arguments

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.

Value

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.

See Also

unique, duplicated, rules-class, itemsets-class, itemMatrix-class

Examples

data("Adult")

### get unique transactions
vals <- unique(Adult)

### count frequency of unique transactions
cnts <- tabulate(match(Adult, vals))

### plot frequency of unique transactions
plot(sort(cnts, decreasing=TRUE))


[Package arules version 0.3-1 Index]