File: SparseM.image.Rd

package info (click to toggle)
r-cran-sparsem 1.84-2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,648 kB
  • sloc: fortran: 3,998; ansic: 75; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,336 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
\name{SparseM.image}
\title{Image Plot for Sparse Matrices}
\alias{image}
\alias{SparseM.image}
\alias{image,matrix.csr-method}
\description{Display the pattern of non-zero entries of
  a matrix of class \code{matrix.csr}.% or \code{matrix.csc}
}
\usage{
\S4method{image}{matrix.csr}(x, col=c("white","gray"),
      xlab="column", ylab="row", \dots)
}
\arguments{
  \item{x}{a matrix of class \code{matrix.csr}.}% or \code{matrix.csc}.}
  \item{col}{a list of colors such as that generated by \code{\link{rainbow}}.
    Defaults to c("white","gray")}
  \item{xlab,ylab}{each a character string giving the labels for the x and y axis.}
  \item{\dots}{additional arguments.}
}
\details{The pattern of the non-zero entries of a sparse matrix
is displayed.  By default nonzero entries of the matrix appear
as gray blocks and zero entries as white background.}
\references{
  Koenker, R and Ng, P. (2002).
  SparseM:  A Sparse Matrix Package for \R,\cr
  \url{http://www.econ.uiuc.edu/~roger/research/home.html}
}
\seealso{
\code{SparseM.ops},
\code{SparseM.solve},
\code{SparseM.ontology}
}
\examples{
a <- rnorm(20*5)
A <- matrix(a,20,5)
A[row(A)>col(A)+4|row(A)<col(A)+3] <- 0
b <- rnorm(20*5)
B <- matrix(b,20,5)
B[row(A)>col(A)+2|row(A)<col(A)+2] <- 0
image(as.matrix.csr(A)\%*\%as.matrix.csr(t(B)))
}
\keyword{hplot}
\keyword{algebra}