1

I'm trying to export a network I've built in igraph to a gexf format using rgexf so I can use it in Gephi. My basic code is below, plus then I have a few formatting things (removing labels and such) which I haven't included below.

df <- read.csv ("<file>", header = TRUE, sep = ",")
df.network <- graph.data.frame(df, directed=F)
V(df.network)$type <-bipartite.mapping(df.network)$type
plot(df.network, vertex.label.cex = 0.8, vertex.label.color = "black", layout=layout_with_kk, asp=0)

I then use the following

g1.gexf <- igraph.to.gexf(df.network)

but I get the following error message:

Input is not proper UTF-8, indicate encoding !
Bytes: 0xED 0x6E 0x20 0x46
Error: 1: Input is not proper UTF-8, indicate encoding !
Bytes: 0xED 0x6E 0x20 0x46

and g1.gexf isn't written. Can anyone help with what might have gone wrong?

otter77
  • 55
  • 5
  • I believe that [This previous question](https://stackoverflow.com/q/2507608/4752675) will help – G5W Mar 28 '18 at 12:36
  • Thank you - that pointed me in the right direction of confirming it was something to do with the encoding of the file. In the end I replaced all the '&' with 'and' in the file and also exported it from Google Sheets instead of Microsoft Excel and now it seems to work. Thanks again! – otter77 Mar 29 '18 at 13:52

0 Answers0