-
-
Notifications
You must be signed in to change notification settings - Fork 206
Description
The docs say the following when mode is "undirected" (and weighted =TRUE):
First we check that the matrix is symmetric. It is an error if not. Then only the upper triangle is used to create a weighted undirected graph.
But the following code (adapted from the example) runs just fine:
adjm <- matrix(runif(100), 10)
adjm[ adjm<0.5 ] <- 0
graph_from_adjacency_matrix(adjm, weighted=TRUE, mode="undirected")
The example does force a symmetric matrix through (adjm + t(adjm))/2
. When looking at the documentation the function graph.adjacency.sparse
has a check for symmetry but the function graph.adjacency.dense
does not.
Obviously nothing is lost as in with or without a symmetric matrix the result is the same. The question is whether this is intentional and if the docs need to be updated.