igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] trouble with read.graph on Mac


From: MATSUDA, Noriyuki
Subject: Re: [igraph] trouble with read.graph on Mac
Date: Tue, 10 Jul 2007 09:42:57 +0900

Hello:

  Yes, the file contains 2-byte characters in node.name attributes.  However,
I do not know which encoding scheme among several possibilities was applied
to the file.  I'll ask an IT assistant.
Fortunately, the file was revised by my student and it no longer caused errors,
except that 2-byte characters are not readable in R on my Mac.  Strangely,
they are readable in other text processing soft.
  Thanks again for your concern and suggestions.

At 0:50 PM +0200 07.7.9, Gabor Csardi wrote:
The file has some (Japanese?) multibyte characters, this is causing the
problem i think.

Actually for me on Linux it reads the graph ok, but R cannot print the
names, it gives:

 g <- read.graph("ELX-context.gml", format="gml")
 g
Vertices: 48
Edges: 205
Directed: FALSE
Edges:

[0]  Error in print.default(as.matrix(format.data.frame(x, digits = digits,  :
        invalid multibyte string

After removing the characters it works. Is this an utf8-encoded file?
Could you please try to save the graph in graphml format and try
to read it in or send it to me.

Thanks, G.

On Mon, Jul 09, 2007 at 07:25:09PM +0900, MATSUDA, Noriyuki wrote:
 Hello:

    Here's the result of what you suggested below:
      > lines <- scan("ELX-context.gml", what=character(0))
        Read 2382 items
      > g <- graph.ring(10)
      > write.graph(g, file="test.gml", format="gml")
      > g2 <- read.graph("test.gml", format="gml")

   I have attached the the gml file which is also available at
      http://www.sk.tsukuba.ac.jp/~mazda/dA/ELX-context.gml

 Thank you.
 At 11:43 AM +0200 07.7.9, Gabor Csardi wrote:
 >Can you read the file via other R methods?
 >Eg. can you run
 >
 >lines <- scan("ELX-context.gml", what=character(0))
 >
 >If yes then could you please try it for other graphs as well?
 >The easiest to try would be
 >
 >g <- graph.ring(10)
 >write.graph(g, file="test.gml", format="gml")
 >g2 <- read.graph("test.gml", format="gml")
 >
 >If this works for you then could you please send me the graph you want to
 >read, or at least a minimal example graph which does not work
 >for you.
 >
 >Thanks,
 >Gabor
 >
 >On Mon, Jul 09, 2007 at 05:42:43PM +0900, MATSUDA, Noriyuki wrote:
 >> Hello:
 >>
 >>    I encountered an error in read.graph on Mac
 >>     > read.graph("ELX-context.gml",format="gml")
 >>       Error in read.graph.gml(file, ...) : At rinterface.c:3380 :
 >> Cannot read GML file, File operation error
 >>
 >>   The "ELX-context.gml" was created on a Window machine by my assistant
 >>   and
 >> sent to me by email-attachment.  It was successfully imported into
 >> Cytoscape.
 >> --
 >> MATSUDA, Noriyuki
 >>
 >>
 >> _______________________________________________
 >> igraph-help mailing list
 >> address@hidden
 >> http://lists.nongnu.org/mailman/listinfo/igraph-help
 >
 >--
 >Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK
 >
 >
 >_______________________________________________
 >igraph-help mailing list
 >address@hidden
 >http://lists.nongnu.org/mailman/listinfo/igraph-help



 _______________________________________________
 igraph-help mailing list
 address@hidden
 http://lists.nongnu.org/mailman/listinfo/igraph-help


--
Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help






reply via email to

[Prev in Thread] Current Thread [Next in Thread]