Learn R Programming

base (version 3.3)

mat.or.vec: Create a Matrix or a Vector

Description

mat.or.vec creates an nr by nc zero matrix if nc is greater than 1, and a zero vector of length nr if nc equals 1.

Usage

mat.or.vec(nr, nc)

Arguments

nr, nc
numbers of rows and columns.

Examples

Run this code
mat.or.vec(3, 1)
mat.or.vec(3, 2)

Run the code above in your browser using DataLab