scientific notation break graph.data.frame with vertices argument
Bug #1082221 reported by
R Vesco
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Fix Released
|
Low
|
Gábor Csárdi |
Bug Description
Using the graph.data.frame function along with a vertices data.frame will complain that there exists vertices in the edgelist that do not exist the in vertices dataframe.
The cause for this bug has something todo with scientific notation which creates duplicate vertices for numbers such as
100000 200000 and so on....
The workaround for this bug is to disable scientific notation:
options(scipen=999)
Then the function graph.data.frame will work as expected.
tags: | added: gnu-r |
Changed in igraph: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Thanks for your report!
I think this happens, if the symbolic names are not of type character for one argument and character for the other. E.g.
library(igraph) id=c("1001" , "100000", "200000")) from=c( 1001, 100000, 200000), to=c(100000, 200000, 100000)) frame(dat, vertices=verts)
verts <- data.frame(
dat <- data.frame(
g <- graph.data.
An easy workaround is to convert everything to character. But I'll add the options(scipen) to graph.data.frame anyway.