vech | R Documentation |
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.
vech(x)
vechs(x)
cvec(x)
rvec(x)
x |
A matrix |
A vector of values
Based on functions from the the OpenMx package
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.