
Reconstruct a matrix from a flattened upper triangle vector
rs_upper_triangle_to_dense.Rd
This function takes a flattened vector of the upper triangle from a
symmetric matrix (think correlation matrix) and reconstructs the full
dense matrix for you.
Arguments
- data
Numeric vector. The vector of for example correlation coefficients that you want to use to go back to a dense matrix.
- shift
Boolean. If
TRUE,dataexcludes the diagonal and the diagonal is set to1. IfFALSE,dataincludes the diagonal.- n
Integer. Original dimension (i.e., ncol/nrow) of the matrix to be reconstructed.