vec: Vectorize a Matrix

vecR Documentation

Vectorize a Matrix

Description

Returns a 1-column matrix, stacking the columns of x, a matrix or vector. Also supports comma-separated inputs similar to the concatenation function c.

Usage

vec(x, ...)

Arguments

x

A matrix or vector

...

(optional) additional objects to be stacked

Value

A one-column matrix containing the elements of x and ... in column order

Examples

vec(1:3)
vec(matrix(1:6, 2, 3))
vec(c("hello", "world"))
vec("hello", "world")
vec(1:3, "hello", "world")

friendly/matlib documentation built on March 3, 2024, 12:18 p.m.