c-methods: Combining Objects

c-methodsR Documentation

Combining Objects

Description

c combines a collection of (timed) sequences or sequence rules into a single object.

Usage

## S4 method for signature 'sequences'
c(x, ..., recursive = FALSE)

## S4 method for signature 'timedsequences'
c(x, ..., recursive = FALSE)

## S4 method for signature 'sequencerules'
c(x, ..., recursive = FALSE)

Arguments

x

an object.

...

(a list of) further objects of the same class as x

.

recursive

a logical value specifying if the function should descend through lists.

Value

For c and unique an object of the same class as x.

Note

Method c is similar to rbind but with the added twist that objects are internally conformed matching their item labels. That is, an object based on the union of item labels is created.

For timed sequences event times are currently conformed as follows: if the union of all labels can be cast to integer the labels are sorted. Otherwise, labels not occurring in x are appended.

The default setting does not allow any object to be of a class other than x, i.e. the objects are not combined into a list.

Author(s)

Christian Buchta

See Also

Class sequences, timedsequences, sequencerules, method match.

Examples

## continue example
example(ruleInduction, package = "arulesSequences")
s <- c(s1, s2)
s
match(unique(s), s1)

## combine rules
r <- c(r2, r2[1:2])
r
match(unique(r), r2)

## combine timed sequences
z <- as(zaki, "timedsequences")
match(z, c(z[1], z[-1]))

arulesSequences documentation built on Sept. 11, 2024, 9:35 p.m.