Learn R Programming

DistatisR (version 1.1.1)

ldiag: Left (i.e., pre) Multiply a matrix by a diagonal matrix

Description

ldiag: Left (i.e., pre) Multiply a matrix by a diagonal matrix (with only the diagonal elements being given).

Usage

ldiag(y, X)

Value

an \(I\) by \(J\) matrix equal to diag(y)

Arguments

y

a \(I\) element vector (of the diagonal elements of an \(I\) by \(I\) matrix)

X

an \(I\) by \(J\) matrix.

Author

Hervé Abdi

See Also

rdiag