{"id":13857297,"url":"https://github.com/wpgp/popRF","last_synced_at":"2025-07-13T21:32:15.744Z","repository":{"id":48301331,"uuid":"369354393","full_name":"wpgp/popRF","owner":"wpgp","description":"Random Forest-informed Population Disaggregation R package","archived":false,"fork":false,"pushed_at":"2023-12-17T08:58:22.000Z","size":8084,"stargazers_count":30,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-06T03:03:26.873Z","etag":null,"topics":["disaggregation","population","random-forest"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpgp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-20T22:37:20.000Z","updated_at":"2024-05-24T14:18:19.000Z","dependencies_parsed_at":"2023-12-18T22:25:36.631Z","dependency_job_id":"74135ec8-a93c-44d6-8d2b-99d940bc611e","html_url":"https://github.com/wpgp/popRF","commit_stats":{"total_commits":115,"total_committers":2,"mean_commits":57.5,"dds":0.4173913043478261,"last_synced_commit":"bee3af9f86512f10e7609fd733f51aee9c73b04d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpgp%2FpopRF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpgp%2FpopRF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpgp%2FpopRF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpgp%2FpopRF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpgp","download_url":"https://codeload.github.com/wpgp/popRF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225920256,"owners_count":17545459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["disaggregation","population","random-forest"],"created_at":"2024-08-05T03:01:32.753Z","updated_at":"2024-11-22T15:30:25.010Z","avatar_url":"https://github.com/wpgp.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"## popRF: Random Forest-informed Population Disaggregation R package\n\nHigh resolution, recent data on human population distributions are important for measuring impacts of population growth, monitoring human-environment interactions and for planning and policy development. Many methods are used to disaggregate census data and predict population densities for finer scale, gridded population data sets.  \n`popRF` is a population modelling R package utilizing Random Forests to inform a dasymetric redistribution of census-based population count data. A description of using Random Forests machine learning method  in `popRF` is described in [Stevens et al](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0107042). \n\n### Installation\nThe `popRF` package can be installed directly from Github.\n\n``` r\ninstall.packages(\"devtools\")\ndevtools::install_github(\"wpgp/popRF\")\n```\n\n### Demo \n\nThe `popRF` package has a demo function `popRFdemo` to generate a population layer\nusing the [WorldPop](https://www.worldpop.org) geospatial covariates and\nsubnational census-based population estimates for 230 countries. \nAll necessary covariates will be downloaded and used to disaggregat population.\nAll input datasets use a geographical coordinate system (GCS) with WGS 1984\ndatum (EPSG:4326) in Geotiff format at a resolution of 3 arc-second\n(0.00083333333 decimal degree, approximately 100m at the equator).\n\nThe following script will produce a population layer for Nepal (NPL) using 4 cores.\n\n``` r\nlibrary(\"popRF\")\n\npopRFdemo(project_dir=\"/home/user/demo\",\n          country=\"NPL\", \n          cores=4)\n \n```\n\n### Basic Usage\n\n``` r\nlibrary(\"popRF\")\n\n# Specifying a name of the file from which the unique area ID and corresponding \n# population values are to be read from. The file should contain two columns \n# comma-separated with the value of administrative ID and population without\n# columns names. If it does not contain an absolute path, the file name is \n# relative to the current working directory\n\npop_table \u003c- list(\"NPL\"=\"/user/npl_population.csv\")\n\n\n# Specifying a nested list of named list(s), i.e. where each element of the\n# first list is a named list object with atomic elements. The name of\n# each named list corresponds to the 3-letter ISO code of a specified\n# country. The elements within each named list define the specified\n# input covariates to be used in the random forest model, i.e. the name\n# of the covariates and the corresponding, if applicable and local, path\n# to them. If the path is not a full path, it is assumed to be relative\n# to the current working directory\n\ninput_cov \u003c- list(\n                  \"NPL\"= list(\n                             \"cov1\" = \"covariate1.tif\",\n                             \"cov2\" = \"covariate2.tif\"\n                     )\n                  )\n                     \n# Specifying a named list where each element of the list defines the\n# path to the input mastergrid(s), i.e. the template gridded raster(s)\n# that contains the unique area IDs as their value. The name(s)\n# corresponds to the 3-letter ISO code(s) of a specified country(ies).\n# Each corresponding element defines the path to the mastergrid(s). If\n# the path is local and not a full path, it is assumed to be relative to\n# the current working directory                     \n\ninput_mastergrid \u003c- list(\"NPL\" = \"npl_mastergrid.tif\")\n\n# Specifying a named list where each element of the list defines the path\n# to the input country-specific watermask. The name corresponds to the\n# 3-letter ISO code of a specified country. Each corresponding element\n# defines the path to the watermask, i.e. the binary raster that\n# delineates the presence of water (1) and non-water (0), that is used\n# to mask out areas from modelling. If the path is local and not a full\n# path, it is assumed to be relative to the current working directory.\n\n\ninput_watermask \u003c- list(\"NPL\" = \"npl_watermask.tif\")\n\n# Specifying a named list where each element of the list defines the path\n# to the input raster(s) containing the pixel area. The name corresponds\n# to the 3-letter ISO code of a specified country. Each corresponding\n# element defines the path to the raster whose values indicate the area\n# of each unprojected (WGS84) pixel. If the path is local and not a full\n# path, it is assumed to be relative to the current working directory.\n\ninput_px_area \u003c- list(\"NPL\" = \"npl_px_area.tif\")\n\n# Running a model\n\nres \u003c- popRF(pop=pop_table,\n             cov=input_cov,\n             mastergrid=input_mastergrid,\n             watermask=input_watermask,\n             px_area=input_px_area,\n             output_dir=\"/user/output\",\n             cores=4)\n\n# Plot populataion raster\nplot(res$pop)\n\n# Plot Error via Trees\nplot(res$popfit)\n```\n\n\u003cimg src=\"man/figures/example_ppp_ECU_v2.jpg\" width=\"100%\" /\u003e\n\n### Outputs\n\nPopulation raster layer in GeoTiff format.\n\n## Contributions\n\nContributions are welcome. Please raise or respond to an issue, or create a new\nbranch to develop a feature/modification and submit a pull request.\n\n## Acknowledgements\n\n``` r\n#\u003e citation(\"popRF\")\n\n#\u003e To cite popRF in publications use:\n#\u003e \n#\u003e Bondarenko M., Nieves J.J., Forrest R.S., Andrea E.G., Jochem C., Kerr D., and Sorichetta A. (2021): popRF: Random Forest-informed Population\n#\u003e Disaggregation R package, _Comprehensive R Archive Network (CRAN)_, url:https://cran.r-project.org/package=popRF.\n#\u003e\n#\u003e A BibTeX entry for LaTeX users is\n#\u003e \n#\u003e @Manual{,\n#\u003e  title = {popRF: Random Forest-informed Population Disaggregation R package.},\n#\u003e  author = {Maksym Bondarenko and Jeremiah J Nieves and Forrest R. Stevens and Andrea E. Gaughan and Chris Jochem and David Kerr and Alessandro Sorichetta},\n#\u003e  year = {2021},\n#\u003e  journal = {Comprehensive R Archive Network (CRAN)},\n#\u003e  url = {https://cran.r-project.org/package=popRF},\n#\u003e  language = {English},\n#\u003e }\n  \n```\n\n### License\n[GNU General Public License v3.0 (GNU GPLv3)](https://www.gnu.org/licenses/gpl-3.0.en.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpgp%2FpopRF","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpgp%2FpopRF","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpgp%2FpopRF/lists"}