在R中读取gml文件 [英] Read gml file in R
问题描述
当我尝试阅读政治书籍数据集。我使用命令:
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
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,:参数NA / NaN
Erreur dans (grep("graphics", edg, fixed = TRUE)[(i - 1)] + 2):(grep("graphics", : argument NA / NaN
我在每个数据集中都有这个问题
i have this problem in every dataset ".gml"
推荐答案
你可以这样做,
g<-read.graph("dolphins.gml",format=c("gml"))
,它可以用于任何外国格式:它使用 ict 包
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"), ...)
这篇关于在R中读取gml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!