You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function graph_from_edgelist automatically infers the existance of unmentioned vertices
I found no clarification of this in the function doc. I think it's an unintuitive programming practice.
Example
This code describes a graph with three vertices, and two edges. However, because the vertices just happen to be named 100,101,102, the generated plot is massive and contains vertices named 1-99, not connected to the actual graph described.
Thank you! Posting your reproducible example as reprex for easier later browsing
library("igraph")
#> #> Attaching package: 'igraph'#> The following objects are masked from 'package:stats':#> #> decompose, spectrum#> The following object is masked from 'package:base':#> #> unionedges<-data.frame(V1= c(100,101), V2= c(101,102))
edges<- as.matrix(edges)
edges#> V1 V2#> [1,] 100 101#> [2,] 101 102
plot(igraph::graph_from_edgelist(edges))
If it is a numeric matrix then its elements are interpreted as vertex ids
But maybe we should make this point more prominent in the docs. @TheLaughingDuck where and how would you expect this info? Happy to then update the docs.
The function graph_from_edgelist automatically infers the existance of unmentioned vertices
I found no clarification of this in the function doc. I think it's an unintuitive programming practice.
Example
This code describes a graph with three vertices, and two edges. However, because the vertices just happen to be named 100,101,102, the generated plot is massive and contains vertices named 1-99, not connected to the actual graph described.
The text was updated successfully, but these errors were encountered: