scientific notation break graph.data.frame with vertices argument

Bug #1082221 reported by R Vesco
6
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: gnu-r

Related branches

R Vesco (rlvesco7)
tags: added: gnu-r
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

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)
verts <- data.frame(id=c("1001", "100000", "200000"))
dat <- data.frame(from=c(1001, 100000, 200000), to=c(100000, 200000, 100000))
g <- graph.data.frame(dat, vertices=verts)

An easy workaround is to convert everything to character. But I'll add the options(scipen) to graph.data.frame anyway.

Changed in igraph:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Gábor Csárdi (gabor.csardi)
milestone: none → 0.6.1
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Fixed in revisions 3018 (0.6-main) and 3068 (0.7-main).

Changed in igraph:
status: Confirmed → Fix Committed
Changed in igraph:
status: Fix Committed → Fix Released
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/301

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.