Introduction Case

Assume we have a group of 10 business engineering students working on a group project. Some of them follow data analytics (DA) and the others operations research (OR). They all belong to one of the two groups: DA or OR. These students sometimes collaborate when they are working on a group project. They can therefore be linked together to form a network. In this case, two students are connected if they are currently working together. As a result we have three types of edges in the network:

1. Create the Data and the Network

names <- c('A','B','C','D','E','F','G','H','I','J')
master <- c(rep('DA',6), rep('OR',4))
Students <- data.frame(name=names, master=master)
StudentsNetwork <- data.frame(from=c('A','A','A','A','B','B','C','C','D','D','D', 'E','F','F','G','G','H','H','I'),
                               to=c('B','C','D','E','C','D','D','G','E','F', 'G','F','G','I','I','H','I','J','J'),
                               label=c(rep('dd',7),'do','dd','dd','do','dd','do','do',rep('oo',5)))

This code results in the following table:

from to label from to label
A B dd D G do
A C dd E F dd
A D dd F G do
A E dd F I do
B C dd G I oo
B D dd G H oo
C D dd H I oo
C G do H J oo
D E dd I J oo
D F dd

Practice

Assume we have a group of 6 students: Tom, Sofie, Arno, Jan, Karen and Laura. Assume that Tom, Sofie and Arno are business engineering (B) students, while Jan, Karen and Laura are studying economics (E). They all belong to one of the two groups: B or E. All 6 students are going on an exchange programme next semester. Therefore, the students can be linked together based on the destination that they are going to:

Destination Student 1 Student 2
France Tom Arno
Switzerland Sofie Jan
China Karen Laura

As a result we have three types of edges in the network:

Exercise

Create a data frame, named StudentsNetwork, that contains all the relationships between the students that are following an exchange programme.