在R中读取gml文件 [英] Read gml file in R

查看:2024
本文介绍了在R中读取gml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试阅读政治书籍数据集。我使用命令:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆