This function was part of the package ENA. This package is no more available
and it cannot be installed from archive because some dependencies are no more
available.
The method to use to make the matrix symmetric. Default is to take the maximum.
"max"
For each position, \(m_{i,j}\), use the maxiumum of \((m_{i,j}, m_{j,i})\)
"min"
For each position, \(m_{i,j}\), use the minimum of \((m_{i,j}, m_{j,i})\)
"avg"
For each position, \(m_{i,j}\), use the mean: \((m_{i,j} + m_{j,i})/2\)
"ld"
Copy the lower triangular portion of the matrix to the upper triangular portion.
"ud"
Copy the upper triangular portion of the matrix to the lower triangular portion.
adjacencyList
Logical. If false, returns the symmetric matrix (the same format as the input). If true, returns an adjacency list representing the upper triangular portion of the adjacency matrix with addressing based on the row.names of the matrix provided.
#Create a sample 3x3 matrixmat <- matrix(1:9, ncol=3)
#Copy the upper diagonal portion to the lowersymmetricize(mat, "ud")
#Take the average of each symmetric locationsymmetricize(mat, "avg")