Learn R Programming

WES (version 1.0.0)

download_worldpop_data: Download WorldPop population raster data

Description

This function takes a single ISO country code and downloads the appropriate population count raster data (100m grid cell resolution) from the WorldPop FTP data server. Note that these data are spatial disaggregations of census data using random forest models described in Lloyd et al. 2019 and available for manual download at https://hub.worldpop.org/geodata/listing?id=29. Downloaded data sets are saved to the path_output directory in .tif format.

Usage

download_worldpop_data(
  iso3,
  year,
  constrained = FALSE,
  UN_adjusted = FALSE,
  path_output
)

Value

Character string giving path to downloaded data.

Arguments

iso3

A three-letter capitalized character string. Must follow the ISO-3166 Alpha-3 country code standard (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3). Can accept a vector of multiple ISO codes.

year

A numeric or integer scalar giving the year of WorldPop data to download (as of 2024-05-15, years 2000-2020 are available)

constrained

Logical indicating whether to get population counts estimated using constrained models (details HERE). Default is FALSE.

UN_adjusted

Logical indicating whether to get population counts that are adjusted to match United Nations national population estimates (details HERE). Default is FALSE.

path_output

A character string giving the file path of an output directory to save downloaded data.

Examples

Run this code
# \donttest{

download_worldpop_data(iso3 = 'MCO',
                       year = 2020,
                       constrained = TRUE,
                       UN_adjusted = FALSE,
                       path_output = tempdir())

# }

Run the code above in your browser using DataLab