Saving a graph in Pajek with color attributes

Bug #905915 reported by Richard O. Legendi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
Confirmed
Undecided
Gábor Csárdi

Bug Description

I tried to save a simple graph in Pajek format with defined color values, but I get the following error message:

    > g <- graph.ring(10)
    > V(g)$color <- "red"
    > write.graph(g, format="pajek", file="C:\\tmp\\test.net")
    Error in write.graph.pajek(graph, file, ...) :
      At rinterface.c:761 : No such attribute, Invalid value
    Error during wrapup:
    >

I found the list archives, and found some hints to update to the most recent version of igraph. I've just updated to igraph_0.5.5-3 rj_0.5.5-4, but still no change.

I've also tried some alternatives like using set.vertex.attribute and ' and ` characters to define the color values, but wasn't able to make it work.

Based on the documentation I found in ?read.graph, there are two tables stating that the color values should work (if I got it right).

My sessionInfo() output:

> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=Hungarian_Hungary.1250 LC_CTYPE=Hungarian_Hungary.1250
[3] LC_MONETARY=Hungarian_Hungary.1250 LC_NUMERIC=C
[5] LC_TIME=Hungarian_Hungary.1250

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] igraph_0.5.5-3 rj_0.5.5-4

loaded via a namespace (and not attached):
[1] tools_2.12.1

Tamás Nepusz pointed out at the igraph mailing list that I may have stumbled upon a bug, because the code is even worse on Mac OS X:

> library(igraph)
g <> g <- graph.ring(10)
> V(g)$color <- "red"
> V(g)$color
 [1] "red" "red" "red" "red" "red" "red" "red" "red" "red" "red"
> write.graph(g, format="pajek", file="test.net")
 *** caught segfault ***
address 0x8, cause 'memory not mapped'

Traceback:
 1: .Call("R_igraph_write_graph_pajek", graph, file, PACKAGE = "igraph")
 2: write.graph.pajek(graph, file, ...)
 3: write.graph(g, format = "pajek", file = "test.net")

He said that this is 0.6 (not 0.5.x), and it looks like the bug has been around for a while.

Tamás Nepusz (ntamas)
Changed in igraph:
status: New → Confirmed
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/446

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.