我有一个双模网络的边缘列表,类似于:
person Event
Amy football_game
Sam picnic
Bob art_show
Run Code Online (Sandbox Code Playgroud)
我想在R中对此进行分析,但看起来我尝试的一切都失败了.将其转换为单模式网络会遇到内存限制,我无法弄清楚如何在igraph或tnet中将其分析为二分.
在igraph中,bipartite.projection给我所有FALSE,在使用的igraph对象上
net <- graph.edgelist(myobject)
Run Code Online (Sandbox Code Playgroud)
在tnet上,我无法将igraph网转换为tnet网,当我尝试使用原始数据框时,它会因图中的重复而拒绝.
因此,以下任何一个的答案将非常感激:
bipartite.mapping功能?很抱歉,如果这些是基本问题,但文档很少.
例:
edgelist <- read.table(text="Person Event
Amy football
Bob picnic
Sam artshow",
header=TRUE)
edgelist <- as.matrix(edgelist)
## Igraph Issues
igraph <- graph.edgelist(edgelist)
typevector <- bipartite.projection(igraph)
# gets all FALSE
edgelist2 <- get.edgelist(igraph)
typevector <- bipartite.projection(edgelist2)
# same thing
## tnet issues
tnet <- as.tnet(edgelist)
# gives error: "There are duplicate events in the edgelist" …Run Code Online (Sandbox Code Playgroud)