[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Problems with Pajek file format (node attributes)
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Problems with Pajek file format (node attributes) |
Date: |
Wed, 7 Jul 2010 10:24:24 +0200 |
Hmmm, I think this is a bug in igraph's Pajek exporter. As a
workaround, you can replace the spaces with underscore or some other
character, before exporting the graph to Pajek. E.g.
V(g)$shape <- gsub(" ", "_", V(g)$shape, fixed=TRUE)
I have created a bug report for this:
https://bugs.launchpad.net/igraph/+bug/602587
Best,
Gabor
On Tue, Jul 6, 2010 at 6:22 PM, Riccardo Tasso <address@hidden> wrote:
> Dear all,
> I have the following pajek file, wich I import in R with the usual g <-
> read.graph(filename, 'pajek'):
>
> *vertices 3
> 1 98 "a"
> 2 11 "b"
> 3 38 "c d"
> *arcs
> 1 2 3
> 2 1 1
> 3 1 8
>
> Each node has a numeric attribute and a string attribute.
> When I serialize my network with graph.write(g, filename, 'pajek'), I obtain
> a strange text file:
>
> *Vertices 3
> 1 "98" a
> 2 "11" b
> 3 "38" c d
> *Arcs
> 1 2 3
> 2 1 1
> 3 1 8
>
> The problem is that without quotes strings with spaces give a parse error
> reading back the last pajek written:
>
> Error in read.graph.pajek(file, ...) :
> At foreign.c:574 : Parse error in Pajek file, line 3 (syntax error), Parse
> error
>
> Is there a way to resolve my problem?
> Thank you,
> Riccardo
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
--
Gabor Csardi <address@hidden> UNIL DGM