diag2vec {OpenMx}R Documentation

Extract Diagonal of a Matrix

Description

Given an input matrix, diag2vec returns a column vector of the elements along the diagonal.

Usage

diag2vec(x)

Arguments

x an input matrix.

Details

Similar to the function diag, except that the input argument is always treated as a matrix.

See Also

vec2diag

Examples


diag2vec(matrix(1:9, 3, 3))
diag2vec(matrix(1:12, 3, 4))



[Package OpenMx version 0.3.2-1263 Index]