Title: | Small Africa Map Datasets for Learning |
---|---|
Description: | Small African datasets to help with learning and teaching of spatial techniques and mapping. Part of afrimapr project. To provide analysts based in Africa with more easily relateable example datasets. R objects for points, lines, polygons and raster. Source files including .gpkg, .shp, .kml, .tif, .grd, .csv. |
Authors: | Andy South [aut, cre] , Chris Littleboy [ctb] , Shelmith Kariuki [ctb] |
Maintainer: | Andy South <[email protected]> |
License: | CC0 |
Version: | 0.0.0.9003 |
Built: | 2024-10-27 05:05:08 UTC |
Source: | https://github.com/afrimapr/afrilearndata |
a sf
object points of African airports.
See data-raw/afrilearndata-creation.R for how the data object is created.
afriairports
afriairports
Formal class 'sf'; 50 rows 5 columns
id id numeric
ident ident XXXX
type large_airport medium_airport small_airport
name airport name
elevation_ft elevation in feet
continent continent code AF
country_name country name
iso_country country code two letters capitalised
region_name name of region
iso_region iso region code incl country XX-YY
local_region region code excl country YY
municipality municipality
scheduled_service scheduled_service 1=yes, 2=no
gps_code gps charecter code
iata_code iata character code
local_code local code
home_link web page url
wikipedia_link wikipedia url
keywords keywords
score score
last_updated last update
geometry coordinates of the point sfc_POINT
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://ourairports.com/continents/AF/airports.csv
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(afriairports) # or read from the csv file which is stored in package as example to work with # filename <- system.file("extdata","afriairports.csv", package="afrilearndata", mustWork=TRUE) # dfairports <- readr::read_csv(filename) # and convert to sf object # afriairports <- sf::st_as_sf(dfairports, coords=c("longitude_deg", "latitude_deg"), crs=4326) #plot(sf::st_geometry(afriairports)) }
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(afriairports) # or read from the csv file which is stored in package as example to work with # filename <- system.file("extdata","afriairports.csv", package="afrilearndata", mustWork=TRUE) # dfairports <- readr::read_csv(filename) # and convert to sf object # afriairports <- sf::st_as_sf(dfairports, coords=c("longitude_deg", "latitude_deg"), crs=4326) #plot(sf::st_geometry(afriairports)) }
a sf
object points of African capital cities
See data-raw/afrilearndata-creation.R for how the data object is created.
africapitals
africapitals
Formal class 'sf'; 50 rows 5 columns
capitalname character vector capital city names
countryname character vector country names
pop numeric estimated population 2006
iso3c character vector ISO 3 letter country code
geometry sfc_POINT
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://cran.r-project.org/web/packages/maps/
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(africapitals) # or filename <- system.file("extdata","africapitals.gpkg", package="afrilearndata", mustWork=TRUE) africapitals <- sf::read_sf(filename) #plot(sf::st_geometry(africapitals)) }
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(africapitals) # or filename <- system.file("extdata","africapitals.gpkg", package="afrilearndata", mustWork=TRUE) africapitals <- sf::read_sf(filename) #plot(sf::st_geometry(africapitals)) }
a sf
object containing low resolution African continent outline
See data-raw/afrilearndata-creation.R for how the data object is created.
africontinent
africontinent
Formal class 'sf';
name character vector continent name
geometry sfc_MULTIPOLYGON
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://www.naturalearthdata.com/downloads/110m-cultural-vectors/
https://cran.r-project.org/web/packages/rnaturalearth/
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(africontinent) # or filename <- system.file("extdata","africontinent.shp", package="afrilearndata", mustWork=TRUE) africontinent <- sf::read_sf(filename) plot(sf::st_geometry(africontinent)) }
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(africontinent) # or filename <- system.file("extdata","africontinent.shp", package="afrilearndata", mustWork=TRUE) africontinent <- sf::read_sf(filename) plot(sf::st_geometry(africontinent)) }
a sf
object containing low resolution African country boundaries
See data-raw/afrilearndata-creation.R for how the data object is created.
africountries
africountries
Formal class 'sf'; 51 rows, 8 columns
name character vector country names
name_long character vector country names long
pop_est numeric estimated population
gdp_md_est numeric estimated gdp
lastcensus numeric year of last census
income_grp character vector income group
iso_a3 character vector ISO 3 letter country code
geometry sfc_MULTIPOLYGON
name_fr character vector French country names
name_pt character vector Portuguese country names
name_af character vector Afrikaans country names
name_sw character vector Swahili country names
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://www.naturalearthdata.com/downloads/110m-cultural-vectors/
https://cran.r-project.org/web/packages/rnaturalearth/
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(africountries) # or filename <- system.file("extdata","africountries.shp", package="afrilearndata", mustWork=TRUE) africountries <- sf::read_sf(filename)#' plot(sf::st_geometry(africountries)) }
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(africountries) # or filename <- system.file("extdata","africountries.shp", package="afrilearndata", mustWork=TRUE) africountries <- sf::read_sf(filename)#' plot(sf::st_geometry(africountries)) }
a sf
object of simplified lines of transcontinental highway network
See data-raw/afrilearndata-creation.R for how the data object is created.
afrihighway
afrihighway
Formal class 'sf'; 100 rows, 2 columns
Name character vector of section names
geom sfc_LINESTRING
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://en.wikipedia.org/wiki/Trans-African_Highway_network
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(afrihighway) # or filename <- system.file("extdata","trans-african-highway.kml", package="afrilearndata", mustWork=TRUE) afrihighway <- sf::read_sf(filename) #remove Description column, only has contents in first row afrihighway <- afrihighway[ , which(names(afrihighway)!='Description')] plot(sf::st_geometry(afrihighway)) }
if (requireNamespace("sf", quietly = TRUE)) { library(sf) data(afrihighway) # or filename <- system.file("extdata","trans-african-highway.kml", package="afrilearndata", mustWork=TRUE) afrihighway <- sf::read_sf(filename) #remove Description column, only has contents in first row afrihighway <- afrihighway[ , which(names(afrihighway)!='Description')] plot(sf::st_geometry(afrihighway)) }
a raster
object storing the majority landcover in 2019 for all 20km squares in Africa.
Categorical, 20km resolution from MODIS.
Cell values are numeric, landcover type names are stored in Raster Attribute Table (RAT) that can be accessed via levels(afrilandcover)
See data-raw/afrilearndata-creation.R for how the data object is created.
afrilandcover
afrilandcover
Formal class 'raster';
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://lpdaac.usgs.gov/products/mcd12c1v006/
Friedl, M., D. Sulla-Menashe. MCD12C1 MODIS/Terra+Aqua Land Cover Type Yearly L3 Global 0.05Deg CMG V006. 2015, distributed by NASA EOSDIS Land Processes DAAC, https://doi.org/10.5067/MODIS/MCD12C1.006. Accessed 2021-06-07.#'
if (requireNamespace("raster", quietly = TRUE)) { library(raster) data(afrilandcover) # or filename <- system.file("extdata","afrilandcover.grd", package="afrilearndata", mustWork=TRUE) afrilandcover <- raster::raster(filename) plot(afrilandcover) } # interactive plotting with mapview if (requireNamespace("mapview", quietly = TRUE) & requireNamespace("rgdal", quietly = TRUE)) { library(mapview) mapview(afrilandcover, att="landcover", col.regions=levels(afrilandcover)[[1]]$colour) }
if (requireNamespace("raster", quietly = TRUE)) { library(raster) data(afrilandcover) # or filename <- system.file("extdata","afrilandcover.grd", package="afrilearndata", mustWork=TRUE) afrilandcover <- raster::raster(filename) plot(afrilandcover) } # interactive plotting with mapview if (requireNamespace("mapview", quietly = TRUE) & requireNamespace("rgdal", quietly = TRUE)) { library(mapview) mapview(afrilandcover, att="landcover", col.regions=levels(afrilandcover)[[1]]$colour) }
a raster
object modelled population density 2000 per square km from WorldPop aggregated to mean per 20km squares
afripop2000
afripop2000
Formal class 'raster';
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://www.worldpop.org/geodata/summary?id=24757
https://www.worldpop.org WorldPop datasets are licensed under Creative Commons Attribution 4.0 International (CC BY 4.0) https://creativecommons.org/licenses/by/4.0/
if (requireNamespace("raster", quietly = TRUE)) { library(raster) data(afripop2000) # or filename <- system.file("extdata","afripop2000.tif", package="afrilearndata", mustWork=TRUE) afripop2000 <- raster::raster(filename) plot(afripop2000) }
if (requireNamespace("raster", quietly = TRUE)) { library(raster) data(afripop2000) # or filename <- system.file("extdata","afripop2000.tif", package="afrilearndata", mustWork=TRUE) afripop2000 <- raster::raster(filename) plot(afripop2000) }
a raster
object modelled population density 2020 per square km from WorldPop aggregated to mean per 20km squares
See data-raw/afrilearndata-creation.R for how the data object is created.
afripop2020
afripop2020
Formal class 'raster';
Geographical coordinates WGS84 datum (CRS EPSG 4326)
https://www.worldpop.org/geodata/summary?id=24777
https://www.worldpop.org WorldPop datasets are licensed under Creative Commons Attribution 4.0 International (CC BY 4.0) https://creativecommons.org/licenses/by/4.0/
if (requireNamespace("raster", quietly = TRUE)) { library(raster) data(afripop2020) # or filename <- system.file("extdata","afripop2020.tif", package="afrilearndata", mustWork=TRUE) afripop2020 <- raster::raster(filename) plot(afripop2020) }
if (requireNamespace("raster", quietly = TRUE)) { library(raster) data(afripop2020) # or filename <- system.file("extdata","afripop2020.tif", package="afrilearndata", mustWork=TRUE) afripop2020 <- raster::raster(filename) plot(afripop2020) }