triangle2vector: Transform a Symmetric Matrix to it's Vectorised Form and Vise...

Description Usage Arguments Value Functions See Also

View source: R/triangle2vector.R

Description

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.

Usage

1
2
3
triangle2vector(matr, diag = FALSE)

vector2triangle(vect, diag = FALSE, diag_value = NA)

Arguments

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.

Value

the transformed matrix / vector

Functions

See Also

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()


itamarfaran/corrfuncs documentation built on Nov. 26, 2021, 12:02 p.m.