| africa_segments | R Documentation |
A dataset containing 14,358 raw network segments representing intersected road routes
between African cities. Each segment is defined by start and end coordinates with
aggregate importance metrics. This dataset is provided to demonstrate how package
functions like consolidate_graph() and
simplify_network() can process messy segment data
into clean analytical networks like africa_network.
data(africa_segments)
A data frame with 14,358 rows and 7 columns:
Numeric. Start point longitude (range: -17.4 to 49.2).
Numeric. Start point latitude (range: -34.2 to 37.2).
Numeric. End point longitude (range: -17.0 to 49.1).
Numeric. End point latitude (range: -34.2 to 37.2).
Integer. Number of optimal inter-city routes passing through this segment. Range: 1 to 1,615, median: 46.
Numeric. Sum of population gravity weights from routes using this segment. Computed as sum of (pop_origin * pop_destination / spherical_distance_km) / 1e9.
Numeric. Sum of road-distance-weighted gravity from routes. Computed as sum of (pop_origin * pop_destination / road_distance_m) / 1e9.
This dataset represents an intermediate stage in network construction, after routes have been
intersected but before network simplification. The segments have been simplified using
linestrings_from_graph() to retain only start and end coordinates.
The segments can be used to demonstrate the flownet network processing workflow:
Convert segments to an sf LINESTRING object using linestrings_from_graph()
Apply consolidate_graph() to merge nearby nodes
Apply simplify_network() to remove intermediate nodes
The passes field indicates how many optimal city-to-city routes use each segment,
serving as a measure of segment importance in the network. Higher values indicate
segments that are critical for efficient inter-city connectivity.
Derived from OpenStreetMap routing data via OSRM, processed through route intersection and aggregation.
Dataset constructed for: Krantz, S. (2024). Optimal Investments in Africa's Road Network. Policy Research Working Paper 10893. World Bank. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1596/1813-9450-10893")}. Replication materials: https://github.com/SebKrantz/OptimalAfricanRoads.
africa_network, consolidate_graph(),
simplify_network(), linestrings_from_graph(),
flownet-package
data(africa_segments)
head(africa_segments)
# Summary statistics
summary(africa_segments[, c("passes", "gravity", "gravity_rd")])
# Segments with highest traffic
africa_segments[order(-africa_segments$passes), ][1:10, ]
# Convert to sf and plot
library(sf)
segments_sf <- linestrings_from_graph(africa_segments)
plot(segments_sf["passes"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.