display {spam} | R Documentation |
The function represents the nonzero entries in a simple bicolor plot.
display(x, ...)
x |
matrix of class spam . |
... |
any other arguments passed
to image.default /plot . |
.Spam$imagesize
determines if the sparse matrix is
coerced into a matrix and the plotted with image.default
or if
the matrix is simply represented as a scatterplot with
pch="."
. The points are scaled according to
cex*.Spam$cex/(nrow+ncol)
. For some devices or for non-square matrices,
cex
needs probably some adjustment.
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$imagesize <- 1000 display(smat) .Spam$imagesize <- 10 display(smat) # very large but very sparse matrix nz <- 128 ln <- nz^2 smat <- spam(0,ln,ln) smat[cbind(sample(ln,nz),sample(ln,nz))] <- 1:nz par(mfcol=c(1,1),pty='s') display(smat, cex=100)