Learn R Programming

brainGraph (version 2.7.3)

symmetrize_mats: Create a symmetric matrix

Description

symmetrize_mats will symmetrize a numeric matrix by assigning the off-diagonal elements values of either the max, min, or average of \(\{A(i, j), A(j, i)\}\). The default is max because that is the default for graph_from_adjacency_matrix.

symmetrize_array is a convenience function which applies symmetrize_mats along the 3rd dimension of an array.

Usage

symmetrize_mats(A, symm.by = c("max", "min", "avg"))

symmetrize_array(A, ...)

Arguments

A

Numeric matrix

symm.by

Character string; how to create symmetric off-diagonal elements (default: max)

...

Arguments passed to symmetrize_mats

Value

Either a single symmetrized matrix, or an (3D) array

See Also

graph_from_adjacency_matrix

Other Matrix functions: apply_thresholds, cor.diff.test, create_mats