Session Ready
Exercise

Overlapping edges

The two fundamental building blocks of a social network are nodes and edges. The weights are usually positive values.

The dataset edges contains the edges for a small network. Multiple edges between two nodes in the network could indicate a stronger link between the nodes compared to only one edge between the nodes. Instead of showing each edge individually, you can make the edges overlap where the width is equal to the number of edges.

The igraph library is loaded in your workspace, as well as the dataset edges.

Instructions
100 XP
  • Create an undirected graph called net based on dataset edges with graph_from_data_frame() and set directed to the appropriate boolean (TRUE or FALSE).
  • Plot network net with plot() and set layout to be layout_in_circle (no quotation marks ""!).
  • To get overlapping edges, set E(net)$width to the number of multiple edges using count.multiple() on net. Avoid having curved edges by setting E(net)$curved to the appropriate boolean (TRUE or FALSE).
  • Plot net in a circle layout again.