mat.or.vec
Create a Matrix or a Vector

Description

Creates a zero matrix with nr rows and nc columns--unless nc is 1, in which case it creates a numeric vector of length nr.

Usage

mat.or.vec(nr, nc)

Arguments

nr number of rows.
nc number of columns.
Value
if nc is 1, a numeric vector of length nr with all elements set to 0. Otherwise, a numeric nr by nc matrix with all elements set to 0.
See Also
matrix, numeric.
Examples
mat.or.vec(3,4) # Creates a 3 by 4 matrix
mat.or.vec(3,1) # Creates a numeric vector of length 3
Package base version 6.0.0-69
Package Index