Fills a triangular matrix from the inputed vector
vec2mat(x,diag=FALSE,upper=FALSE)
x
: a vectordiag
: whether the vector contains the diagonal elementsupper
: whether the vector contains the upper trinagular matrix elementsa matrix
{ vec2mat(1:10) vec2mat(1:10,diag=TRUE) vec2mat(1:10,upper=TRUE) }
Useful links