vec: Vectorise a matrix

Description Usage Arguments Value Examples

View source: R/aux_funs.R

Description

Vectorise a matrix by stacking its columns in a vector.

Usage

1
vec(mat)

Arguments

mat

An (M x N) matrix with arbitrary dimensions M and N.

Value

A column matrix of dimension NM x 1.

Examples

1
2
3
mat <- matrix(1:15, 3, 5)
vec(mat)
all.equal(mat, matrix(vec(man), 3, 5))

nielsaka/zeitreihe documentation built on March 17, 2020, 8:38 p.m.