Provides the generic function itemFrequency()
and methods to get the
frequency/support for all single items in an objects based on
itemMatrix. For example, it is used to get the single
item support from an object of class transactions
without mining.
itemFrequency(x, ...)# S4 method for itemMatrix
itemFrequency(x, type = c("relative", "absolute"), weighted = FALSE)
# S4 method for tidLists
itemFrequency(x, type = c("relative", "absolute"))
itemFrequency
returns a named numeric vector. Each element
is the frequency/support of the corresponding item in object x
. The
items appear in the vector in the same order as in the binary matrix in
x
.
an object of class itemMatrix or tidLists.
further arguments are passed on.
a character string specifying if "relative"
frequency/support or "absolute"
frequency/support (item counts) is
returned. (default: "relative"
).
should support be weighted by transactions weights stored as
column "weight"
in transactionInfo?
Michael Hahsler
itemFrequencyPlot()
Other itemMatrix and transactions functions:
abbreviate()
,
crossTable()
,
c()
,
duplicated()
,
extract
,
hierarchy
,
image()
,
inspect()
,
is.superset()
,
itemFrequencyPlot()
,
itemMatrix-class
,
match()
,
merge()
,
random.transactions()
,
sample()
,
sets
,
size()
,
supportingTransactions()
,
tidLists-class
,
transactions-class
,
unique()
data("Adult")
itemFrequency(Adult, type = "relative")
Run the code above in your browser using DataLab