matlib (version 0.9.2)

vec: Vectorize a Matrix

Description

Returns a 1-column matrix, stacking the columns of x, a matrix or vector

Usage

vec(x)

Arguments

x

A matrix or vector

Value

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

Examples

Run this code
# NOT RUN {
vec(1:3)
vec(matrix(1:6, 2, 3))
vec(c("hello", "world"))
# }

Run the code above in your browser using DataCamp Workspace