View source: R/general_functions.R
lowertri2mat | R Documentation |
Transform a vector containing lower diagonal entries into a symmetric matrix of dimension p.
lowertri2mat(lowertri_vec, p, diag = FALSE)
lowertri_vec |
A |
p |
A |
diag |
A |
A numeric
p x p symmetric matrix.
Haotian Xu
A = matrix(1:16, 4, 4) B = lowertri2mat(A[lower.tri(A)], 4, diag = FALSE) C = lowertri2mat(A[lower.tri(A, diag = TRUE)], 4, diag = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.