vec2diag: Create Diagonal Matrix From Vector

Description Usage Arguments Details See Also Examples

View source: R/MxAlgebraFunctions.R

Description

Given an input row or column vector, vec2diag returns a diagonal matrix with the input argument along the diagonal.

Usage

1

Arguments

x

a row or column vector.

Details

Similar to the function diag, except that the input argument is always treated as a vector of elements to place along the diagonal.

See Also

diag2vec

Examples

1
2
vec2diag(matrix(1:4, 1, 4))
vec2diag(matrix(1:4, 4, 1))

OpenMx documentation built on June 20, 2017, 9:04 a.m.

Search within the OpenMx package
Search all R packages, documentation and source code