Learn R Programming

arules (version 1.7-9)

size: Number of Items in Sets

Description

Provides the generic function size() and methods to get the size of each itemset in an itemMatrix or associations. For example, size() can be used to get a vector with the number of items in each transaction.

Usage

size(x, ...)

# S4 method for itemMatrix size(x)

# S4 method for tidLists size(x)

# S4 method for itemsets size(x)

# S4 method for rules size(x)

Value

returns a numeric vector of length length(x). Each element is the size of the corresponding element (row in the itemMatrix) in object x. For rules, size() returns the sum of the number of items in the LHS and the RHS.

Arguments

x

an object.

...

further (unused) arguments.

Author

Michael Hahsler

See Also

Other itemMatrix and transactions functions: abbreviate(), c(), crossTable(), duplicated(), extract, hierarchy, image(), inspect(), is.superset(), itemFrequency(), itemFrequencyPlot(), itemMatrix-class, match(), merge(), random.transactions(), sample(), sets, supportingTransactions(), tidLists-class, transactions-class, unique()

Other associations functions: abbreviate(), associations-class, c(), duplicated(), extract, inspect(), is.closed(), is.generator(), is.maximal(), is.redundant(), is.significant(), is.superset(), itemsets-class, match(), rules-class, sample(), sets, sort(), unique()

Examples

Run this code
data("Adult")
summary(size(Adult))

Run the code above in your browser using DataLab