g2c_download is an R package that provides easy access to various WorldPop geospatial covariates.
To install the package from GitHub, first ensure you have the devtools
package installed:
install.packages("devtools") # Install devtools if not already installed
devtools::install_github("wpgp/g2Covariates")
Once installed, load the package in your R session:
library(g2Covariates)
g2c_download(covariate, ISO, prj_year, rst_mask, output_dir)
Downaloding covariate for "ISO" country for "prj_year" year using "rst_mask" as mask.
get_names_covariates()
[1] "Coastline" "Elevation" "Slope" "Built_surface" "Built_volume" "Built_surface_NRES"
[7] "Built_volume_NRES" "built_S_dist" "esalc_11_dst" "esalc_40_dst" "esalc_130_dst" "esalc_140_dst"
[13] "esalc_150_dst" "esalc_160_dst" "esalc_190_dst" "esalc_200_dst" "esalc_210_dst" "viirs"
[19] "dist_inland_water" "Precipitation" "Temperature" "WDPA" "highway_dist_osm" "rd_intrs_dist_osm"
[25] "waterbodies_dist_osm" "watermask" "building_count_gl" "building_count_ms"
nb_countries <- get_global_nb()
nb_countries[["NPL"]]
[1] "CHN" "IND"
This package requires the following R packages:
terra
jsonlite
Ensure they are installed before using the package:
install.packages(c("terra", "jsonlite"))
Contributions are welcome! If you'd like to improve this package, please:
- Fork the repository.
- Make changes in a new branch.
- Submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you use g2Covariates in your research, please cite:
Bondarenko M., Priyatikanto R., Zhang W., McKeen T., Nosatiuk B. and Tejedor-Garavito N. (2025). g2Covariates is an R package that provides easy access to various WorldPop geospatial covariates. (1.0.0) DOI: 10.5281/zenodo.15267943 [Computer software]. GitHub. https://github.com/wpgp/g2Covariates
@software{g2Covariates,
title = {g2Covariates is an R package that provides easy access to various WorldPop geospatial covariates.},
author = {Bondarenko M., Priyatikanto R., Zhang W., McKeen T., Nosatiuk B. and Tejedor-Garavito N..},
year = 2025,
month = 4,
publisher = {GitHub},
doi = {10.5281/zenodo.15267943},
url = {https://github.com/wpgp/g2Covariates},
version = {1.0.0}
}
- Issues & Support: https://github.com/wpgp/g2Covariates/issues
- WorldPop SDI: https://sdi.worldpop.org