
Last chance! 50% off unlimited learning
Sale ends in
itemFrequency
counts the number of distinct occurrences of items
or itemsets (elements) in a collection of sequences. That is, multiple
occurrences within a sequence are ignored. itemTable
cross-tabulates the counts an item or itemset
occurs in a sequence.
nitems
computes the total number of distinct occurrences of items
or itemsets in a collection of sequences.
dim
retrieves the dimensions of an object of class
or
.
length
retrieves the number of elements of a collection of
sequences or sequence rules.
## S3 method for class 'sequences':
itemFrequency(x, itemsets = FALSE, type = c("absolute", "relative"))## S3 method for class 'sequences':
itemTable(x, itemsets = FALSE)
## S3 method for class 'sequences':
nitems(x, itemsets = FALSE)
## S3 method for class 'sequences':
dim(x)
## S3 method for class 'timedsequences':
dim(x)
## S3 method for class 'sequences':
length(x)
## S3 method for class 'sequencerules':
length(x)
itemFrequency
returns a vector of counts corresponding with
the reference set of distinct items or itemsets. For itemTable
returns a table with the rownames corresponding
with the reference set of distinct items or itemsets.
For nitems
a scalar value.
For dim
and class sequences
a vector of length three
containing the number of sequences and the dimension of the reference
set of distinct itemsets. For class timedsequences
the fourth
element contains the number of distinct event times.
For length
a scalar value.
sequences
,
timedsequences
,
method
size
,
subset
.## continue example
example(cspade)
##
itemFrequency(s2)
itemFrequency(s2, itemsets = TRUE)
##
itemTable(s2)
itemTable(s2, itemsets = TRUE)
##
nitems(s2)
nitems(s2, itemsets = TRUE)
##
length(s2)
dim(s2)
##
z <- as(zaki, "timedsequences")
dim(z)
Run the code above in your browser using DataLab