问题
i have problem when i try to read a gml file of political books dataset. i use the command:
hh=read.table("polbooks.gml")
Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : la ligne 2 n'avait pas 2 éléments
and when i use this one:
library(multiplex)
hh=read.gml("polbooks.gml")
Erreur dans (grep("graphics", edg, fixed = TRUE)[(i - 1)] + 2):(grep("graphics", : argument NA / NaN
i have this problem in every dataset ".gml"
回答1:
you can do like this,
g<-read.graph("dolphins.gml",format=c("gml"))
and it's can be used for any foreign format: it's used the igraph package
read.graph(file, format = c("edgelist", "pajek", "ncol", "lgl",
"graphml", "dimacs", "graphdb", "gml", "dl"), ...)
回答2:
Version 1.5 of multiplex
solved this bug.
来源:https://stackoverflow.com/questions/28964898/read-gml-file-in-r