sgCMatrix-class {arulesSequences}R Documentation

Class "sgCMatrix" – Sparse Ordered Lists of Symbols

Description

Sparse pseudo matrices in column-compressed form for storing ordered lists of symbols.

Objects from the Class

Most frequently, an object is created upon creation of an object of class sequences or
sequencerules.

Objects can also be created by calls of the form new("sgCMatrix", ...).

Slots

p:

an integer vector of length the number of columns in the matrix plus one. These are zero-based pointers into i, i.e. to the first element of a list. However, note that the last element contains the number of elements of i.

i:

an integer vector of length the number of non-zero elements in the matrix. These are zero-based symbol indexes, i.e. pointers into the row names if such exist.

Dim:

an integer vector representing the number of symbols and the number of lists.

Dimnames:

a list with components for symbol and list labels.

factors:

unused, for compatibility with package Matrix only.

Methods

coerce

signature(from = "sgCMatrix", to = "list")

coerce

signature(from = "list", to = "sgCMatrix")

coerce

signature(from = "ngCMatrix", to = "sgCMatrix")

dim

signature(x = "sgCMatrix")

dimnames

signature(x = "sgCMatrix")

dimnames<-

signature(x = "sgCMatrix", value = "ANY")

show

signature(x = "sgCMatrix")

Note

The number of rows can be larger than the number of symbols actually occurring. Thus i need not be recoded upon subsetting or two collections of lists with the same index base can be easily combined (column or row-wise).

Many of the methods of this class implemented in C are currently not interfaced as R methods.

Author(s)

Christian Buchta

See Also

Class sequences, timedsequences, sequencerules.

Examples

## 3 example sequences
x <- list("01" = list(c("A","B"), "C"), 
          "02" = list("C"), 
	  "03" = list("B", "B"))

## uses paste
s <- as(x, "sgCMatrix")
s

##
dim(s)
dimnames(s)

[Package arulesSequences version 0.2-25 Index]