在R中读取gml文件

标签 r dataset graph-modelling-language

当我尝试读取 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/

相关文章:

Mac 上的 R 错误 : "family ' Times New Roman' not included in postscript() device"

python - 将列表转换为 svm 输入

google-cloud-platform - BigQuery 适用于小型数据集吗?

dataset - KITTI 立体数据集中的焦距和主点是多少?

r - 如何将包含网络数据的 csv 文件转换为 GML

python - 如何使用 python 从 G(n,p) 图创建邻接矩阵?

r - source() 相对于当前脚本目录的路径?

r markdown vitae 包 "Undefined control sequence"编织到 vitae 预定义简历模板时出错

r - 在 R 直方图中作为参数 'breaks' 传递的单个数字意味着什么?