LoslegenKostenlos loslegen

Compare Subscriber vs. Non-Subscriber Distances

Let's compare subscriber to non-subscriber graphs by distance. Remember we can think of subscribers as local Chicago residents who regularly use the bikes, whereas non-subscribers are likely to be more casual users or tourists. Also it's important to keep in mind that this graph is a representation of geography. Which graph do you think has a further geographic distance? Why?

get_diameter() and farthest_vertices() both provide the vertices in the graph that have the longest "shortest route" between them – get_diameter() provides all the intermediate vertices, whereas farthest_vertices() provides the end vertices and the number of nodes between them.

calc_physical_distance_m(), a function that takes in two station IDs as inputs and calculates the physical distance between the stations (in meters), is also provided. You can view the function by running calc_physical_distance_m in the console.

Diese Übung ist Teil des Kurses

Case Studies: Network Analysis in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Get the diameter of the subscriber graph
get_diameter(___)

# Get the diameter of the customer graph
get_diameter(___)

# Find the farthest vertices of the subscriber graph
farthest_vertices(___)

# Find the farthest vertices of the customer graph
farthest_vertices(___)
Code bearbeiten und ausführen