Learn R Programming

flownet (version 0.1.2)

africa_segments: Raw Network Segments for Trans-African Transport Network

Description

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.

Usage

data(africa_segments)

Arguments

Format

A data frame with 14,358 rows and 7 columns:

FX

Numeric. Start point longitude (range: -17.4 to 49.2).

FY

Numeric. Start point latitude (range: -34.2 to 37.2).

TX

Numeric. End point longitude (range: -17.0 to 49.1).

TY

Numeric. End point latitude (range: -34.2 to 37.2).

passes

Integer. Number of optimal inter-city routes passing through this segment. Range: 1 to 1,615, median: 46.

gravity

Numeric. Sum of population gravity weights from routes using this segment. Computed as sum of (pop_origin * pop_destination / spherical_distance_km) / 1e9.

gravity_rd

Numeric. Sum of road-distance-weighted gravity from routes. Computed as sum of (pop_origin * pop_destination / road_distance_m) / 1e9.

Details

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:

  1. Convert segments to an sf LINESTRING object using linestrings_from_graph()

  2. Apply consolidate_graph() to merge nearby nodes

  3. 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.

See Also

africa_network, consolidate_graph(), simplify_network(), linestrings_from_graph(), flownet-package

Examples

Run this code
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, ]

# \donttest{
# Convert to sf and plot
library(sf)
segments_sf <- linestrings_from_graph(africa_segments)
plot(segments_sf["passes"])
# }

Run the code above in your browser using DataLab