Learn R Programming

flownet (version 0.2.1)

africa_cities_ports: African Cities and International Ports

Description

A spatial dataset containing 453 major African cities (population > 100,000) and international ports. Cities are deduplicated within 50-100km radii, with populations aggregated from nearby settlements. Port cities include cargo flow data from the World Bank Global Ports dataset.

Usage

data(africa_cities_ports)

Arguments

Format

A Simple feature collection (sf object, also inheriting from data.table) with 453 POINT features and 12 fields:

city_country

Character. Unique city-country identifier (e.g., "Cairo - Egypt", "Lagos - Nigeria").

city

Character. City name.

country

Character. Country name.

iso2

Character. ISO 3166-1 alpha-2 country code.

iso3

Character. ISO 3166-1 alpha-3 country code.

admin_name

Character. Administrative region or province name.

capital

Character. Capital status: "" (none), "admin" (administrative), "minor", or "primary" (national capital).

population

Numeric. City population including nearby settlements within 30km.

port_locode

Character. UN/LOCODE port identifier (empty string for non-port cities).

port_name

Character. Official port name (empty string for non-port cities).

port_status

Character. Port status code (empty string for non-port cities).

outflows

Numeric. Outflows in TEU in Q1 of 2020 (NA for non-port cities). 51 cities have port outflow data.

geometry

POINT. Spatial geometry in WGS 84 (EPSG:4326) coordinate reference system.

Details

The dataset was constructed by:

  1. Selecting cities with population > 50,000 from Simplemaps World Cities database

  2. Weighting by administrative importance (capital status)

  3. Deduplicating within 50-100km radii, keeping largest weighted city

  4. Aggregating populations from settlements within 30km

  5. Matching with World Bank international ports within 30km

The bounding box spans from approximately 34S to 37N latitude and 17W to 49E longitude, covering continental Africa.

See Also

africa_network, africa_trade, flownet-package

Examples

Run this code
library(sf)
data(africa_cities_ports)
head(africa_cities_ports)

# View largest cities
largest <- africa_cities_ports[order(-africa_cities_ports$population), ]
largest[1:10, c("city", "country", "population")]

# Filter port cities
ports <- africa_cities_ports[!is.na(africa_cities_ports$port_locode), ]
nrow(ports)  # 51 ports

# \donttest{
plot(africa_cities_ports["population"])
# }

Run the code above in your browser using DataLab