Skip to contents

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 class 'itemMatrix'
size(x)

# S4 method for class 'tidLists'
size(x)

# S4 method for class 'itemsets'
size(x)

# S4 method for class 'rules'
size(x)

Arguments

x

an object.

...

further (unused) arguments.

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.

Author

Michael Hahsler

Examples

data("Adult")
summary(size(Adult))
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>    9.00   12.00   13.00   12.53   13.00   13.00