Description Usage Arguments Value Functions See Also
View source: R/triangle2vector.R
A symmetric matrix can be entirely summarized with one of its triangles. these functions transform a matrix's lower triangle to a vectorized form, and transform a vector to a symmetric matrix. In correlation matrices, the diagonal is redundant, so it is possible to vectorize the off diagonal triangle.
1 2 3 | triangle2vector(matr, diag = FALSE)
vector2triangle(vect, diag = FALSE, diag_value = NA)
|
matr |
the matrix to vectorize it's lower triangle |
diag |
if true, vectorize (or construct) the diagonal of the matrix as well |
vect |
the vector to transform to a symmetric matrix |
diag_value |
if diag is set to false, what value to place on the diagonal. default is NA, for correlation matrices set to 1. |
the transformed matrix / vector
vector2triangle
: inverse of triangle2vector
Other vectriangle:
convert_corr_array_to_data_matrix_raw()
,
convert_data_matrix_to_corr_array_raw()
Other vectriangle:
convert_corr_array_to_data_matrix_raw()
,
convert_data_matrix_to_corr_array_raw()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.