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

length

Getting the Number of Elements


Description

S4 methods for length which return the number of elements of objects defined in the package arules.

Usage

## S4 method for signature 'rules'
length(x)

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

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

## S4 method for signature 'itemMatrix'
length(x)

Arguments

x

an object of class transactions, rules, itemsets, tidLists, or itemMatrix.

Details

For itemMatrix and transactions the length is defined as the number of rows (transactions) in the binary incidence matrix.

For sets of associations (rules, itemsets and associations in general) the length is defined as the number of elements in the set (i.e., the number of rules or itemsets).

For tidLists the length is the number of lists (one per item or itemset) in the object.

Value

An integer scalar giving the “length” of x.

Author(s)

Michael Hahsler


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.