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

crossTable

Cross-tabulate joint occurrences across pairs of items


Description

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

Usage

crossTable(x, ...) 
## S4 method for signature '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.

Author(s)

Michael Hahsler

See Also

Examples

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]

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.