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

itemFrequency

Getting Frequency/Support for Single Items


Description

Provides the generic function itemFrequency and S4 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.

Usage

itemFrequency(x, ...)

## S4 method for signature 'itemMatrix'
itemFrequency(x, type, weighted = FALSE)

Arguments

x

an object.

...

further arguments are passed on.

type

a character string specifying if "relative" frequency/support or "absolute" frequency/support (item counts) is returned. (default: "relative").

weighted

should support be weighted by transactions weights stored as column "weight" in transactionInfo?

Value

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.

Author(s)

Michael Hahsler

See Also

Examples

data("Adult")
itemFrequency(Adult, type = "relative")

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.