当我尝试读取 political books dataset 的 gml 文件时遇到问题.我使用命令:
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
当我使用这个时:
library(multiplex)
hh=read.gml("polbooks.gml")
Erreur dans (grep("graphics", edg, fixed = TRUE)[(i - 1)] + 2):(grep("graphics", : argument NA / NaN
我在每个数据集“.gml”中都有这个问题
最佳答案
你可以这样做,
g<-read.graph("dolphins.gml",format=c("gml"))
它可以用于任何外国格式:它使用了 igraph 包
read.graph(file, format = c("edgelist", "pajek", "ncol", "lgl",
"graphml", "dimacs", "graphdb", "gml", "dl"), ...)
关于在R中读取gml文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28964898/