namedSparse-class {ontoTools}R Documentation

Class "namedSparse" adds margin names to sparse matrices

Description

manages margin names for sparse matrices

Objects from the Class

Objects can be created by calls of the form new("namedSparse", ...). These are S4 objects that include a SparseM::matrix.csr, associated dimnames in the customary form, and two lists of name-to-index mapping environments (for row and column name resolution, with forward (name to index) and backward (index to name) mapping).

Slots

Dimnames:
Object of class "list" ordinary dimnames matrix metadata
mat:
Object of class "matrix.csr" sparse matrix
rowindex:
Object of class "list" a list of two environments, n2i for mapping names to numeric indices, and i2n for mapping indices to names
colindex:
Object of class "list" see rowindex

Methods

Arith
signature(e1 = "namedSparse", e2 = "namedSparse"): ...
show
signature(object = "namedSparse"): ...

Note

A constructor makeNamedSparse is illustrated in the example.

Author(s)

VJ Carey <stvjc@channing.harvard.edu>

Examples

data(A.csr)
namedA <- mkNS(A.csr) # installs default dimnames letters,LETTERS
print(namedA)
print(colSums(namedA))
print(colindex(namedA))
dimnames(namedA) <- list(paste("A",1:10,sep=""),paste("B",1:5,sep=""))
print(namedA)
print(namedA %*% t(namedA))

[Package Contents]