sgCMatrix-class | R Documentation |
Sparse pseudo matrices in column-compressed form for storing ordered lists of symbols.
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", ...)
.
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.
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")
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.
Christian Buchta
Class
sequences
,
timedsequences
,
sequencerules
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.