我正在使用一些SNA命令,以在不同顶点和相关权重之间生成边。但是,对于结果,我想知道一些比率,A和B之间的边权重/ A与其他顶点的所有边权重,A和B之间的边权重/ B与其他顶点的所有边权重。
E(g)$weight
relations <-as_ids(E(g)) #here just convert into other format
combination<-cbind(relations,E(g)$weight) #this is what we want
组合的结果看起来很不错:
[![enter image description here][1]][1]
For A:(A-B)/[(A-B)+(A-C)+(A-D)]=21/(21+20+19)=35%
For B:(A-B)/[(A-B)+(B-C)+(B-D)]=21/(21+17+16)=38.9%
My question is: is tehre any command to calculate For A and For B easily? thank you
[1]: https://i.stack.imgur.com/4unMh.png