Let say i have a square matrix and applied the 'vech' operator to stack the 
lower triangular elements into a vector:

> Mat <- matrix(1:25, 5)
> Mat
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    6   11   16   21
[2,]    2    7   12   17   22
[3,]    3    8   13   18   23
[4,]    4    9   14   19   24
[5,]    5   10   15   20   25
> Mat[lower.tri(Mat)]
 [1]  2  3  4  5  8  9 10 14 15 20


Now, I want to reverse-work with the resulting matrix. Means, given a "correct" 
vector, I want to place the elements of this vector into the lower-triangular 
portion of some "correct" square matrix.

Would somebody help me to implement that?

Thanks,

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to