print {spam} | R Documentation |
Printing (non-zero elements) of sparse matrices and summarizing the sparseness structure thereof.
print(x, ...) summary(object, ...)
x |
matrix of class spam or spam.chol. method. |
object |
matrix of class spam or spam.chol. method. |
... |
any other arguments passed
to print.default . |
.Spam$printsize
determines if the sparse matrix is
coerced into a matrix and the printed as an array or if
only the non-zero elements of the matrix are given.
NULL
, because the information is printed with cat
there
is no real need to pass any object back. We also do not see the need
of defining a summary.spam
class with a proper print
method.
Reinhard Furrer
nz <- 8 ln <- nz smat <- spam(0,ln,ln) smat[cbind(sample(ln,nz),sample(ln,nz))] <- 1:nz par(mfcol=c(1,2),pty='s') .Spam$printsize <- 1000 print(smat) .Spam$printsize <- 10 print(smat) summary(smat)