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

### 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 R{1:nrow}, C{1:ncol}
    print(namedA)
    print(colSums(namedA))
    dimnames(namedA) <- list(paste("A",1:10,sep=""),paste("B",1:5,sep=""))
    print(namedA)
    print(namedA %*% t(namedA))

[Package ontoTools version 1.4.8 Index]