vec: Vectorization of a matrix

Description Usage Arguments Value Examples

View source: R/utils.R

Description

This function returns a vector obtained by stacking the columns of x

Usage

1
  vec(x)

Arguments

x

a numeric matrix.

Value

Let x be a n by m matrix, then vec(x) is a nm-dimensional vector.

Examples

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

fastmatrix documentation built on Oct. 18, 2021, 5:08 p.m.

Related to vec in fastmatrix...