Multiple bugs in setbyname.R (patch attached)

Bug #1164579 reported by Alex Lubbock
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
Confirmed
High
Gábor Csárdi

Bug Description

I've had a few issues with the set operation functions in setbyname.R, namely graph.union.by.name, graph.intersection.by.name and graph.difference.by.name. Here's a list:

 - difference, union and intersection by name don't work on directed graphs, despite the documentation saying so
 - safer.merge fails when one data frame has 0 rows and indicate.origin is TRUE
 - get.vertices.as.data.frame returns a 0 column data frame on empty graphs, rather than one empty column as expected
 - related to the above two points, set operations fail if either graph has an empty node or edge list
 - set operations fail if either graph doesn't have a vertex name attribute (sometimes failing silently) - instead, a meaningful error should probably be generated

I've attached a patch which fixes these issues (but could do with further testing). Hope it's helpful.

Revision history for this message
Alex Lubbock (alubbock) wrote :
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Thanks, this looks great, I'll add it soon. I am actually in the process of rewriting these functions to make them more general and faster. BUt until that is finished, your patches will be very useful. Thanks again!

Changed in igraph:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Gábor Csárdi (gabor.csardi)
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/136

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.