Entering edit mode
2.5 years ago
english.server
▴
300
Hi all!
I am trying to differentiate the robustness between Barabasi-Albert (scale free) and Erdos-Renyi (Rnadom graphs). However, The following code fails and I dont know why. Could anyone help me please?
Thank you in advanced.
library(brainGraph)
library(igraph)
ba =sample_pa(10000, directed=F)
er= erdos.renyi.game( length(V(ba)), length(E(ba)), 'gnm' )
er.b= robustness(er, measure = "btwn.cent")
er.d= robustness(er, measure = "degree")
er.r= robustness(er, measure = "random")
ba.b= robustness(ba, measure = "btwn.cent")
ba.d= robustness(ba, measure = "degree")
ba.r= robustness(ba, measure = "random")
plot(ba.b$comp.size); points(er.b$comp.size, col=2)