0

I want to make a network-like the figure below, based on a correlation matrix (c). Where, edge type, size and color is based on strength of (we can make three distinctions, high positive, high negative and one in between) and the pie within each node (red and green color) based on a two (NP) column vector (on column with total positive correlation for a variable and other with negative correlation).

Some random variables

DD<- matrix(NA, 1000, 6)

for (i in 1:6){
    DD[,i]=runif(1000)
}

Their correlation and sums

C=cor(DD)

diag(C)<- 0

NP<- matrix(NA, 6, 2)

NP[,1]<-rowSums(C < 0,na.rm=TRUE)
NP[,2]<-rowSums(C > 0,na.rm=TRUE)

Thanks for the help.

enter image description here

Jawad
  • 27
  • 6
  • please add some data, so that your problem can be reproduced by other users here. Check [https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example] – massisenergy Feb 23 '20 at 13:06
  • I thought it would be a simple solution but it is taking too much time. – Jawad Mar 10 '20 at 13:13

0 Answers0