size {arules}R Documentation

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

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

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

## S4 method for signature '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(s)

Michael Hahsler

See Also

Other itemMatrix and transactions functions: abbreviate(), crossTable(), c(), duplicated(), extract, hierarchy, image(), inspect(), is.superset(), itemFrequencyPlot(), itemFrequency(), 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

data("Adult")
summary(size(Adult))


[Package arules version 1.7-7 Index]