crossTable | R Documentation |
Provides the generic function crossTable()
and a method to
cross-tabulate joint occurrences across all pairs of items.
crossTable(x, ...)
## S4 method for signature 'itemMatrix'
crossTable(
x,
measure = c("count", "support", "probability", "lift"),
sort = FALSE
)
x |
object to be cross-tabulated (transactions or itemMatrix). |
... |
additional arguments. |
measure |
measure to return. Default is co-occurrence counts. |
sort |
sort the items by support. |
A symmetric matrix of n x n, where n is the number of items times
in x
. The matrix contains the co-occurrence counts between pairs of
items.
Michael Hahsler
Other itemMatrix and transactions functions:
abbreviate()
,
c()
,
duplicated()
,
extract
,
hierarchy
,
image()
,
inspect()
,
is.superset()
,
itemFrequency()
,
itemFrequencyPlot()
,
itemMatrix-class
,
match()
,
merge()
,
random.transactions()
,
sample()
,
sets
,
size()
,
supportingTransactions()
,
tidLists-class
,
transactions-class
,
unique()
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]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.