vec {fastmatrix}R Documentation

Vectorization of a matrix

Description

This function returns a vector obtained by stacking the columns of X\bold{X}.

Usage

  vec(x)

Arguments

x

a numeric matrix.

Value

Let X\bold{X} be a nn by mm matrix, then vec(X\bold{X}) is a nmnm-dimensional vector.

Examples

x <- matrix(rep(1:10, each = 10), ncol = 10)
x
y <- vec(x)
y

[Package fastmatrix version 0.5-772 Index]