Exercise

Visualize central vertices

As we saw in the last lesson, station 275 had the lowest out/in degree ratio. We can visualize this using make_ego_graph() to see all the outbound paths from this station. It's also useful to plot this on a geographic coordinate layout, not the default igraph layout. By default, igraph uses the layout_nicely() function to display your graph, making an algorithmic guess about what the best layout should be. However, in this case we want to specify the coordinates of each station, because when a vertex is above another it means it's actually north of it.

Instructions 1/2

undefined XP
    1
    2
  • Use make_ego_graph() and trip_g_simp, create an ego graph of station 275.
  • Plot the ego graph (without geographic coordinates).