\name{namedSparse-class} \docType{class} \alias{namedSparse-class} \alias{colSums} \alias{colSumsSp} \alias{rowSums} \alias{nsparse} \alias{Arith,namedSparse,namedSparse-method} \alias{[,namedSparse-method} \alias{\%*\%,namedSparse,namedSparse-method} \alias{+,namedSparse,namedSparse-method} \alias{as.matrix,namedSparse-method} \alias{colSums,namedSparse,missing,missing-method} \alias{dimnames,namedSparse-method} \alias{dimnames<-,namedSparse,list-method} \alias{mat,namedSparse-method} \alias{maxval,matrix.csr-method} \alias{ncol,namedSparse-method} \alias{nrow,namedSparse-method} \alias{rowSums,namedSparse,missing,missing-method} \alias{show,namedSparse-method} \alias{t,namedSparse-method} \alias{\%+\%} \alias{AMN} \alias{as.matrix.ok} \alias{exns2} \alias{makeNamedSparse} \alias{makeSparseZero} \alias{mapNamesInds} \alias{mat} \alias{maxval} \alias{mkNS} \alias{rowSumsSp} \alias{sumSp} \alias{sumSpSLOW} \alias{colinds,namedSparse,character-method} \alias{rowinds,namedSparse,character-method} \alias{rowinds} \alias{colinds} \title{Class "namedSparse" adds margin names to sparse matrices} \description{ manages margin names for sparse matrices } \section{Objects from the Class}{ Objects can be created by calls of the form \code{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). } \section{Slots}{ \describe{ \item{\code{Dimnames}:}{Object of class \code{"list"} ordinary dimnames matrix metadata } \item{\code{mat}:}{Object of class \code{"matrix.csr"} sparse matrix } } } \section{Methods}{ \describe{ \item{Arith}{\code{signature(e1 = "namedSparse", e2 = "namedSparse")}: ... } \item{show}{\code{signature(object = "namedSparse")}: ... } } } %Undocumented data sets: % A.csr %Undocumented S4 classes: % mapStruct %Undocumented S4 methods: %\section{Methods}{ % \describe{ % \item{%*%}{namedSparse,namedSparse}: matrix multiplication % \item{as.matrix}{\code{signature(x = "namedSparse")}: coerce to R matrix -- %will not coerce very large matrices % \item{show}{\code{signature(object = "namedSparse")}: pretty print % \item{+}{\code{signature(e1 = "namedSparse", e2 = "namedSparse")}: add % \item{Arith}{\code{signature(e1 = "namedSparse", e2 = "namedSparse")}: arithmetic % \item{[}{\code{signature(x = "namedSparse")}: standard subsetting % \item{colSums}{\code{signature(x = "namedSparse", na.rm = "missing", dims = "missing")}: column sums % \item{dimnames}{\code{signature(x = "namedSparse")}: ... % \item{dimnames<-}{\code{signature(x = "namedSparse", value = "list")}: ... % \item{mat}{\code{signature(x = "namedSparse")}: ... % \item{ncol}{\code{signature(x = "namedSparse")}: ... % \item{nrow}{\code{signature(x = "namedSparse")}: ... % \item{rowSums}{\code{signature(x = "namedSparse", na.rm = "missing", dims = "missing")}: ... % } %} %\references{ ~put references to the literature/web site here ~ } \author{ VJ Carey } \note{ A constructor makeNamedSparse is illustrated in the example.} % % ~Make other sections like Warning with \section{Warning }{....} ~ % %\seealso{ % ~~objects to See Also as \code{\link{~~fun~~}}, ~~~ % or \code{\link{CLASSNAME-class}} for links to other classes %} \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)) } \keyword{classes}