Library: | xclust |
See also: | mat2vec distance lpdist agglom cor2dist |
Quantlet: | vec2mat | |
Description: | stores the values of a vector into the upper triangle of a symmetric matrix regarding the sequence described in agglom |
Usage: | d = vec2mat(v) | |
Input: | ||
v | n(n-1)/2 x 1 matrix containing the values of the upper triangle of a symmetric matrix | |
Output: | ||
d | n x n symmetric matrix with zeros in the diagonal |
; load the library xclust library("xclust") ; generate vector v = #(2, 3, 7, 1, 8, 5) ; apply vec2mat vec2mat(v)
Content of object d [1,] 0 2 3 7 [2,] 2 0 1 8 [3,] 3 1 0 5 [4,] 7 8 5 0