我对 R 真的很陌生,我的课程有一个作业。我必须创建1000个鄂尔多斯-人义模型的网络。问题是,我实际上可以创建一个模型,检查它的参数,如度数分布,绘制它等等。我还可以检查它的传递性等等。但是,我必须将这 1000 个网络的平均聚类系数(局部传递性)与我们一直在 Cytoscape 中研究的一些网络进行比较。这是我已经知道的代码:
library(igraph)
g<-erdos.renyi.game(1000,2000, type=c("gnm"))
transitivity(g) #and other atrributes...
g2<-replicate(g,1000)
transitivity(g2[[1]])
#now I have sort of list with every graph but when I try to analyze
#I got the communicate that it is not a graph object
我必须从这 1000 个网络中计算标准差和平均 ACC,然后进行比较。我将不胜感激任何帮助。
我实际上尝试了很多:
g<-erdos.renyi.game(1026,2222,type=c("gnm"))
g2<-1000*g
transitivity(g2[2]) # this however ends in "not a graph object"error
g2[1] #outputs the adjacency matrix but instead of 1026 vertices,
#I've got 1026000 vertices, so multiplication doesn't replicate function
#but parameters
另外,我尝试过统一图表列表
glist<-1000*g
acc<-union(glist, byname="auto")
transitivity(acc) #outputs the same value as first function g (only one
#erdos-renyi graph