Rev 48 | Rev 1323 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{matrix}\title{Create a Matrix}\usage{matrix(data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)as.matrix(x)is.matrix(x)}\alias{matrix}\alias{as.matrix}\alias{is.matrix}\description{\code{matrix} creates a matrix from the given set of values.\code{nrow} gives the desired number of rows and \code{ncol} thedesired number of columns. If either of \code{nrow} or \code{ncol} isnot given, an attempt is made to infer it from the length of\code{data} and the other parameter. If \code{byrow} is \code{FALSE}(the default) the matrix is filled by columns, otherwise the matrix isfilled by rows. A \code{dimnames} attribute for the matrix can bespecified with the optional \code{dimnames} argument (which thus hasto be a list of length 2).\code{as.matrix} attempts to turn its argument into a matrix. Thisfunction is generic.\code{is.matrix} returns \code{TRUE} if \code{x} is a matrix (i.e., ithas a \code{dim} attribute of length 2) and \code{FALSE} otherwise.}\keyword{array}\keyword{algebra}