Plot networks with igraph

血红的双手。 提交于 2019-12-05 17:29:51

You should use abs to select your elements:

t = which(abs(cor.matrix) > 0.6 & lower.tri(cor.matrix),arr.ind=TRUE)

Note the here your matrix contain only 1,-1,NA, maybe you should review how you compute the correlation.

Then use , t indices, to create a color vector like this for example:

E(t.graph)$color =   ifelse(cor.matrix[t] > 0.6,'magenta','green')

then you use the same plot statement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!