.BG
.FN matrix
.FN is.matrix
.FN as.matrix
.TL
Matrix Objects
.CS
matrix(data=NA, nrow, ncol, byrow=FALSE, dimnames)
is.matrix(x)
as.matrix(x)
.AG data
vector containing the data values for the matrix in normal
array order: the first subscript varies most rapidly.
Missing values (`NA's) are allowed.
.AG nrow
first subscript, number of rows.
.AG ncol
second subscript, number of columns
.AG byrow
flag, if `TRUE' the data values are assumed to be the first
row, then the second row, etc. If `FALSE' the
values are assumed to be the first column, then the second
column, etc. (this is how the data is stored internally).
Should be `TRUE' if the data values were read from a file,
arranged by rows.
If one of `nrow' or `ncol' is omitted, the dimensions of the matrix
are determined by the other argument and the length of `data'.
.AG dimnames
an optional list of length 2 giving a `dimnames' attribute for
the matrix.
.PP
.AG x
any S object.
.RT
an `nrow' by `ncol' matrix with the same mode as `data'.
If the data does not fill the matrix, it is repeated until
the matrix is filled.
.PP
`is.matrix' returns `TRUE' if `x' is a matrix object, `FALSE' otherwise.
.PP
`as.matrix' returns `x', if `x' is a matrix; otherwise, a matrix with data from
`x' and dimension `c(length(x),1)'.
.PP
The matrix class of objects are those that have
an attribute `dim' of length 2.
The objects may also have an attribute
`dimnames'.  If so, this is a list of 2 character
vectors, each of which
is either of length zero or else gives the labels corresponding to the
levels of the corresponding subscript in the matrix.
.SA
`array'.
.EX
m <- matrix(0,4,5) #a 4 by 5 matrix of zeros

mm <- matrix( scan("mfile"), ncol=5, byrow=TRUE)
                    #read all rows from the file
.KW array
.KW classes
.WR
