| namedSparse-class {ontoTools} | R Documentation |
manages margin names for sparse matrices
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).
Dimnames:"list" ordinary
dimnames matrix metadata mat:"matrix.csr" sparse matrix rowindex:"list" a list
of two environments, n2i for mapping names to numeric indices,
and i2n for mapping indices to names colindex:"list" see rowindexsignature(e1 = "namedSparse", e2 = "namedSparse"): ... signature(object = "namedSparse"): ... A constructor makeNamedSparse is illustrated in the example.
VJ Carey <stvjc@channing.harvard.edu>
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))