Converts a weights matrix to a vector of weights. If the matrix is symmetric only upper triangle values are returned in the vector.
mat2vec(x, diag = FALSE, tol = 1e-10)A numeric vector of edge weights. If the matrix is symmetric, the upper triangle values are returned; if it is not symmetric, the upper and lower triangle values are returned. If diag = TRUE, all elements of the matrix are returned.
A weights matrix
Logical: should diagonal values be included?
Tolerance used when testing whether the matrix is symmetric
Sacha Epskamp <mail@sachaepskamp.com>