Discussion:
[igraph] Error in read_graph for pajek file
Alex Montgomery
2017-07-13 18:43:12 UTC
Permalink
library(igraph)
g.bio <- read_graph(file="http://people.reed.edu/~ahm/WBBP_MC_PAE.net",format="pajek")
Error in .Call("R_igraph_read_graph_pajek", file, PACKAGE = "igraph") :
At foreign.c:586 : Parse error in Pajek file, line 1 (syntax error, unexpected ALNUM), Parse error
Not sure whether this is a bug or an error due to an unimplemented part of Pajek files.

Thanks
-Alex
--
Alexander H. Montgomery
Associate Professor, Political Science, Reed College
(503) 517-7395 - ***@reed.edu - http://alexmontgomery.com
Jannick
2017-08-10 01:13:29 UTC
Permalink
Hi Alex,
I've been porting some social network labs to igraph from Pajek, and I've
run
Not sure whether this is a bug or an error due to an unimplemented part of Pajek files.
Good guess - indeed optional time intervals as given in your example are
currently not implemented. I added them to the code and just created a pull
request for the patch (https://github.com/igraph/igraph/pull/1023). With
your sample data it runs through like a charm here.

Please note that this is just the first step, because what the patch does
not do is to process the parsed data. The implementation of that second step
I rather leave with Támas and Gábor.
Thanks
-Alex
HTH. Just drop a line if that works, e.g., in case the patch gets approved
and then pushed through github. If you can manage to get the patch working
on your machine, happy to hear if it works or not.

Best
J.
Alex Montgomery
2017-08-10 07:17:09 UTC
Permalink
Terrific, thanks. I tried pulling the new files, incorporating into rigraph, and recompiling, but something about my setup throws an error. I figured out a workaround in the meantime (import through sna, use intergraph), but glad to see that a patch has been committed - I'd need it to be in the official distribution for a class in the fall if I were to use the patch, but with the workaround there's no time pressure.

Cheers
-Alex
Post by Jannick
Hi Alex,
I've been porting some social network labs to igraph from Pajek, and I've
run
Not sure whether this is a bug or an error due to an unimplemented part of Pajek files.
Good guess - indeed optional time intervals as given in your example are
currently not implemented. I added them to the code and just created a pull
request for the patch (https://github.com/igraph/igraph/pull/1023). With
your sample data it runs through like a charm here.
Please note that this is just the first step, because what the patch does
not do is to process the parsed data. The implementation of that second step
I rather leave with Támas and Gábor.
Thanks
-Alex
HTH. Just drop a line if that works, e.g., in case the patch gets approved
and then pushed through github. If you can manage to get the patch working
on your machine, happy to hear if it works or not.
Best
J.
Jannick
2017-08-10 08:52:00 UTC
Permalink
Post by Alex Montgomery
Terrific, thanks. I tried pulling the new files, incorporating into rigraph, and
recompiling, but something about my setup throws an error. I figured out a
workaround in the meantime (import through sna, use intergraph), but glad
to see that a patch has been committed
Great - glad to hear all that. Please keep testing.
Post by Alex Montgomery
Cheers
-Alex
BTW: For Pajek files a comment starts with the percentage sign character ('%') and continues to the end of the line. Thus you can add comments or some documentation regarding the data covered by the file. Best to use pure comment lines starting with '%' only and avoiding '%' in any text field to be on the safe side.

Best,
J.

Loading...