Session Ready
Exercise

Visualize the network highlighting weak ties

In this exercise, we use the ggraph package to visualize weak and strong ties in different colors. It is useful to have an immediate visual perception of the importance of weak ties in a network.

The ties data frame and the network g are already loaded in the workspace for your convenience.

Instructions
100 XP
  • Define a logical vector, is_weak, that contains TRUE if the tie is weak (has weight equal to 1) and FALSE otherwise. Recall that edge attributes use E(g)$some_attribute.
  • Use sum() to check that is_weak contains the correct number of weak ties (recall that there are 214 weak ties).
  • Update the plot by adding an edge link geometry, mapping color to is_weak.