size-methods | R Documentation |
size
computes the size of a sequence. This can be either the number
of (distinct) itemsets (elements) or items occurring in a sequence.
ritems
compute the minimum (maximum) number an item or itemset
(element) is repeatedly occurring in a sequence.
## S4 method for signature 'sequences'
size(x, type = c("size", "itemsets", "length", "items"))
## S4 method for signature 'sequences'
ritems(x, type = c("min", "max"), itemsets = FALSE)
x |
an object. |
type , itemsets |
as string (logical) value specifying the type of count to be computed. |
Returns a vector of counts corresponding with the elements
of object x
.
The total number of items occurring in a sequence is often referred
to as the length of the sequence. Similarly, we refer to the
total number of itemsets as the size
of the sequence. Note
that we follow this terminology in the summary methods.
For use with a collection of rules use the accessors lhs
or rhs
, or coerce to sequences.
Christian Buchta
Class
sequences
,
timedsequences
.
## continue example
example(cspade)
## default size
size(s2)
size(s2, "itemsets")
size(s2, "length")
size(s2, "items")
## crosstab
table(length = size(s1, "length"),
items = size(s1, "items"))
## repetitions
ritems(s1)
ritems(s1, "max")
ritems(s1, "max", TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.