print {spam}R Documentation

Printing and summarizing sparse matrices

Description

Printing (non-zero elements) of sparse matrices and summarizing the sparseness structure thereof.

Usage

  print(x, ...)
  summary(object, ...)

Arguments

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.

Details

spam.getOption('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.

Value

NULL for print, because the information is printed with cat there is no real need to pass any object back.
A list containing the non-zero elements and the density for summary for class spam.
A list containing the non-zero elements of the factor, the density and the fill-in for summary for class spam.chol.NgPeyton.

Author(s)

Reinhard Furrer

See Also

spam.options

Examples

set.seed(13)
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.options( printsize=1000)
print(smat)
spam.options( printsize=10)
print(smat)
summary(smat)
(summary(smat))

[Package spam version 0.15-3 Index]