crossTable

0th

Percentile

Cross-tabulate joint occurrences across pairs of items

Provides the generic function crossTable and the S4 method to cross-tabulate joint occurrences across pairs of items.

Keywords
models
Usage
crossTable(x, ...) 
# S4 method for itemMatrix
crossTable(x, measure = c("count", "support", "probability", 
  "lift", "chiSquared"), sort = FALSE)
Arguments
x

object to be cross-tabulated (transactions or itemMatrix).

measure

measure to return. Default is co-occurence counts.

sort

sort the items by support.

...

aditional arguments.

Value

A symmetric matrix of n time n, where n is the number of items times in x. The matrix contains the co-occurrence counts between pairs of items.

See Also

transactions-class, itemMatrix-class.

Aliases
  • crossTable
  • crossTable,itemMatrix-method
Examples
# NOT RUN {
data("Groceries")

ct <- crossTable(Groceries, sort=TRUE)
ct[1:5, 1:5]

sp <- crossTable(Groceries, measure="support", sort=TRUE)
sp[1:5,1:5]

lift <- crossTable(Groceries, measure="lift", sort=TRUE)
lift[1:5,1:5]

chi2 <- crossTable(Groceries, measure="chiSquared", sort=TRUE)
chi2[1:5,1:5]

# }
Documentation reproduced from package arules, version 1.5-4, License: GPL-3

Community examples

Looks like there are no examples yet.