vech {configural}R Documentation

Vectorize a matrix

Description

cvec returns the column-wise vectorization of an input matrix (stacking the columns on one another). rvec returns the row-wise vectorization of an input matrix (concatenating the rows after each other). vech returns the column-wise half-vectorization of an input matrix (stacking the lower triangular elements of the matrix, including the diagonal). vechs returns the strict column-wise half-vectorization of an input matrix (stacking the lower triangular elements of the matrix, excluding the diagonal). All functions return the output as a vector.

Usage

vech(x)

vechs(x)

cvec(x)

rvec(x)

Arguments

x

A matrix

Value

A vector of values

Author(s)

Based on functions from the the OpenMx package

Examples

cvec(matrix(1:9, 3, 3))
rvec(matrix(1:9, 3, 3))
vech(matrix(1:9, 3, 3))
vechs(matrix(1:9, 3, 3))
vechs(matrix(1:12, 3, 4))

[Package configural version 0.1.5 Index]