arulesSequences (version 0.2-30)

sgCMatrix-class: Class "sgCMatrix" -- Sparse Ordered Lists of Symbols

Description

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

Arguments

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")

Author

Christian Buchta

See Also

Class sequences, timedsequences, sequencerules.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab