
Last chance! 50% off unlimited learning
Sale ends in
subset
extracts a subset of a collection of sequences or sequence
rules which meet conditions specified with respect to their associated
(or derived) quality measures, additional information, or patterns of
items or itemsets. [
extracts subsets from a collection of (timed) sequences or
sequence rules.
unique
extracts the unique set of sequences or sequence rules
from a collection of sequences or sequence rules.
lhs, rhs
extract the left-hand (antecedent) or right-hand side
(consequent) sequences from a collection of sequence rules.
## S3 method for class 'sequences':
subset(x, subset)## S3 method for class 'sequencerules':
subset(x, subset)
## S4 method for signature 'sequences, ANY, ANY, ANY':
x[i, j, ..., reduce = FALSE, drop = FALSE]
## S4 method for signature 'timedsequences, ANY, ANY, ANY':
x[i, j, k, ..., reduce = FALSE, drop = FALSE]
## S4 method for signature 'sequencerules, ANY, missing, ANY':
x[i, j, ..., drop = FALSE]
## S3 method for class 'sequences':
unique(x, incomparables = FALSE)
## S3 method for class 'sequencerules':
unique(x, incomparables = FALSE)
## S3 method for class 'sequencerules':
lhs(x)
## S3 method for class 'sequencerules':
rhs(x)
x
.subset
, [
, and unique
returns an object of the
same class as x
.
For lhs
and rhs
returns an object of class
sequences
.sequences
,
timedsequences
,
sequencerules
,
method
lhs
,
rhs
,
match
,
nitems
,
c
.## continue example
example(ruleInduction, package = "arulesSequences")
## matching a pattern
as(subset(s2, size(x) > 1), "data.frame")
as(subset(s2, x %ain% c("B", "F")), "data.frame")
## as well as a measure
as(subset(s2, x %ain% c("B", "F") & support == 1), "data.frame")
## matching a pattern in the left-hand side
as(subset(r2, lhs(x) %ain% c("B", "F")), "data.frame")
## matching a derived measure
as(subset(r2, coverage(x) == 1), "data.frame")
## reduce
s <- s2[11, reduce = TRUE]
itemLabels(s)
itemLabels(s2)
## drop initial events
z <- as(zaki, "timedsequences")
summary(z[1,,-1])
Run the code above in your browser using DataLab