r - Creating a weighted adjacency matrix with iterations -


i have data on list of directors different companies. directors 1 company meet @ same board of directors. moreover, have data how many times these directors in same board of directors. have create adjacency matrix consisting these directors. nodes represent how many times 2 directors in same board of directors (i.e. if , b company 1, , there 11 meetings in company, hence must 11 on @ intersection of , b , if , b different boards of directors (from different companies), must 0 @ intersection.

i have created matrix in excel via command

=if(vlookup($e2;$a$1:$c$27;2;0)=(vlookup(f$1;$a$1:$c$27;2;0));$c2;0) 

however, main problem 2 or more directors may meet in more 1 board of directors (one company). in case total number of meetings must added together. example, if , b meet in company 1 11 times , in company 3 4 times, must 15 @ intersection and, unfortunately, can't understand how realize it. i've searched similar problems , didn't found cases data in original data repeated. have no idea, whether possible realize in excel or should apply software (r or else)?

enter image description here

see if array formula works you:-

=sum(isnumber(match(if($a$2:$a$27=f$1,$b$2:$b$27,"+"),if($a$2:$a$27=$e2,$b$2:$b$27,"-"),0))*$c$2:$c$27) 

must entered ctrlshiftenter

enter image description here


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

Sound is not coming out while implementing Text-to-speech in Android activity -