🚀 Tasks

As always, the data for this task is on moodle. Follow the instructions in Submission via GitHub Pages to create a new repo in the existing organization.

In this task, you will analyze the cycle network of Switzerland using R. The dataset comes from the Federal Roads Office FEDRO (ASTRA).

The goal is to compute different centrality measures (degree, betweenness and closeness) for the nodes in the network and visualize the results. To do this, follow the following steps:

  1. Load the rail network data using sf

  2. Convert the data into an undirected network using sfnetworks

  3. To calculate centrality, the edges need to have “weights”. Assuming equal cycling speed on all roads, you can use the edge length (from the column length) as the weight.

  4. To compute the centrality measures you will need to

    1. activate the nodes (using tidygraph::activate())
    2. Use dplyr::mutate to create new columns and populate these with the centrality measures using the functions centrality_betweenness, centrality_closeness and centrality_degree from tidygraph using the column length as weights.
  5. Convert the enriched network consisting of edges and nodes back to sf objects consisting of lines and points (using activate and st_as_sf)

  6. The centrality values are attached to the points. Transfer the values to the lines by using the following function, which takes the mean centrality values over all nodes for each edge

    aggregate(veloland_nodes, veloland_edges, FUN = "mean")
  7. Visualize the result (for an example, see Figure 1). If necessary, transform or reasonably categorize the values to make them more comparable

  8. Discuss the results: How do you interpret the differences?

Figure 1: One possible way to visualize the results of your centrality analysis.