How to transform dyadic matrix to edge list

Viewed 43

I have a data like this

Nominator Nominees1 Nominees2 School
1101 1104 1105 01
1102 1105 N/A 01
1103 1104 1105 01
1106 1107 N/A 02
1108 1107 1108 02

This is dyadic matrix. In each school, The Nominator have a connection with Nominees 1 and Nominees 2 with the id given in each column. I want to create 2 directed edge lists, each for school 1 and school 2 based on this dyadic matrix. For example, in each school, I want to have a matrix. This matrix will have the first column as a nominator and the second column is his/her nominees. I am new at R. I know igrpah has function to create graph from edge lists but not from this type of matrix so I want to convert it to edge list. Thank you so much

Nominator Nominees
1101 1104
1101 1105
1102 1105
1103 1104
1103 1105
0 Answers
Related