{"id":38654470,"url":"https://github.com/openwashdata/planetaryhdi","last_synced_at":"2026-01-17T09:25:36.891Z","repository":{"id":267438041,"uuid":"901202252","full_name":"openwashdata/planetaryhdi","owner":"openwashdata","description":"HDI Adjusted for Planetary Pressures","archived":false,"fork":false,"pushed_at":"2024-12-10T15:16:10.000Z","size":1647,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T03:27:15.248Z","etag":null,"topics":["emissions-per-capita","hdi","planetary-pressures","sdgs"],"latest_commit_sha":null,"homepage":"https://openwashdata.github.io/planetaryhdi/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openwashdata.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-10T08:20:46.000Z","updated_at":"2024-12-10T15:16:49.000Z","dependencies_parsed_at":"2024-12-10T11:22:08.993Z","dependency_job_id":"7714dacf-6885-4f75-9dc2-4657fed16e07","html_url":"https://github.com/openwashdata/planetaryhdi","commit_stats":null,"previous_names":["openwashdata/planetaryhdi"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/openwashdata/planetaryhdi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fplanetaryhdi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fplanetaryhdi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fplanetaryhdi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fplanetaryhdi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openwashdata","download_url":"https://codeload.github.com/openwashdata/planetaryhdi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwashdata%2Fplanetaryhdi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28505550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["emissions-per-capita","hdi","planetary-pressures","sdgs"],"created_at":"2026-01-17T09:25:35.069Z","updated_at":"2026-01-17T09:25:36.856Z","avatar_url":"https://github.com/openwashdata.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nalways_allow_html: true\neditor_options: \n  markdown: \n    wrap: 72\n  chunk_output_type: console\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\",\n  message = FALSE,\n  warning = FALSE,\n  fig.retina = 2,\n  fig.align = 'center'\n)\n```\n\n# planetaryhdi\n\n\u003c!-- badges: start --\u003e\n\n[![License: CC BY\n4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14355748.svg)](https://zenodo.org/doi/10.5281/zenodo.14355748)\n[![R-CMD-check](https://github.com/openwashdata/planetaryhdi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openwashdata/planetaryhdi/actions/workflows/R-CMD-check.yaml)\n\n\u003c!-- badges: end --\u003e\n\nThe goal of planetaryhdi is to make data provide a cleaned datasets of planetary pressures-adjusted HDI Index for all countries.\n\n## Installation\n\nYou can install the development version of planetaryhdi from\n[GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"openwashdata/planetaryhdi\")\n```\n\n```{r}\n## Run the following code in console if you don't have the packages\n## install.packages(c(\"dplyr\", \"knitr\", \"readr\", \"stringr\", \"gt\", \"kableExtra\"))\nlibrary(dplyr)\nlibrary(knitr)\nlibrary(readr)\nlibrary(stringr)\nlibrary(gt)\nlibrary(kableExtra)\n```\n\nAlternatively, you can download the individual datasets as a CSV or XLSX\nfile from the table below.\n\n1.  Click Download CSV. A window opens that displays the CSV in\n    your browser.\n2.  Right-click anywhere inside the window and select \"Save Page As...\".\n3.  Save the file in a folder of your choice.\n\n```{r, echo=FALSE, message=FALSE, warning=FALSE}\n\nextdata_path \u003c- \"https://github.com/openwashdata/planetaryhdi/raw/main/inst/extdata/\"\n\nread_csv(\"data-raw/dictionary.csv\") |\u003e \n  distinct(file_name) |\u003e \n  dplyr::mutate(file_name = str_remove(file_name, \".rda\")) |\u003e \n  dplyr::rename(dataset = file_name) |\u003e \n  mutate(\n    CSV = paste0(\"[Download CSV](\", extdata_path, dataset, \".csv)\"),\n    XLSX = paste0(\"[Download XLSX](\", extdata_path, dataset, \".xlsx)\")\n  ) |\u003e \n  knitr::kable()\n\n```\n\n## Data\n\nThe package provides access to Planetary pressures-adjusted HDI Index for all countries and UNDP defined sub-region in one dataset.\n\n```{r}\nlibrary(planetaryhdi)\n```\n\n### planetaryhdi\n\nThe dataset has\n`r nrow(planetaryhdi)` observations and `r ncol(planetaryhdi)`\nvariables\n\n```{r}\nplanetaryhdi |\u003e \n  head(3) |\u003e \n  gt::gt() |\u003e\n  gt::as_raw_html()\n```\n\nFor an overview of the variable names, see the following table.\n\n```{r echo=FALSE, message=FALSE, warning=FALSE}\nreadr::read_csv(\"data-raw/dictionary.csv\", locale = locale(encoding = \"UTF-8\")) |\u003e\n  mutate(across(everything(), ~ iconv(., from = \"UTF-8\", to = \"UTF-8\", sub = \"\"))) |\u003e # Replace invalid UTF-8 characters with \"\"\n  dplyr::filter(file_name == \"planetaryhdi.rda\") |\u003e\n  dplyr::select(variable_name:description) |\u003e\n  knitr::kable() |\u003e\n  kableExtra::kable_styling(\"striped\") |\u003e\n  kableExtra::scroll_box(height = \"200px\")\n```\n\n## Example\n\n### Planetary Pressures Adjusted HDI Index for all countries\n\n```{r}\nlibrary(planetaryhdi)\nlibrary(ggplot2)\nlibrary(rnaturalearthdata)\nlibrary(rnaturalearth)\nlibrary(dplyr)\n\n# 2022 HDI worldwide \nworld \u003c- ne_countries(scale = \"medium\", returnclass = \"sf\")\n\n# Check that planetaryhdi has the necessary columns\nif(!all(c(\"iso3c\", \"phdi\") %in% colnames(planetaryhdi))) {\n  stop(\"planetaryhdi must have columns 'iso3c' and 'phdi'.\")\n}\n\n# Join the world data with the planetaryhdi data\nworld_map_data \u003c- world |\u003e \n  left_join(planetaryhdi, by = c(\"iso_a3\" = \"iso3c\"))\n\n# Handle any NA values that might have been introduced by the join\nworld_map_data$phdi[is.na(world_map_data$phdi)] \u003c- NA\n\n# Define HDI color palette\nhdi_colors \u003c- c(\"#d73027\", \"#fc8d59\", \"#fee08b\", \"#fdae61\", \"#fdd49e\", \"#feedde\", \n                \"#d9ef8b\", \"#a6d96a\", \"#66bd63\", \"#1a9850\", \"#00441b\", \"#003300\", \"#001a00\", \n                \"#e0e0e0\") \n\n# Plot the map\nggplot(data = world_map_data) +\n  geom_sf(aes(fill = cut(phdi, \n                         breaks = c(-Inf, 0.399, 0.449, 0.499, 0.549, 0.599, 0.649, 0.699, \n                                    0.749, 0.799, 0.849, 0.899, 0.950, Inf), \n                         labels = c(\"≤ 0.399\", \"0.400–0.449\", \"0.450–0.499\", \"0.500–0.549\", \n                                    \"0.550–0.599\", \"0.600–0.649\", \"0.650–0.699\", \n                                    \"0.700–0.749\", \"0.750–0.799\", \"0.800–0.849\", \n                                    \"0.850–0.899\", \"0.900–0.950\", \"≥ 0.950\")))) +\n  scale_fill_manual(values = hdi_colors, na.value = \"gray90\", name = \"HDI 2022 Brackets\") +\n  theme_minimal() +\n  labs(title = \"World Planetary Pressures Adjusted HDI (2022)\") +\n  theme(axis.text = element_blank(),\n        axis.ticks = element_blank(),\n        panel.grid = element_blank())\n\n```\n\n\n### Effects of Adjusting HDI with planetary pressures\n\n```{r fig.width=8, fig.height=6, message=FALSE, warning=FALSE}\nlibrary(planetaryhdi)\nlibrary(ggplot2)\n\n# Ensure the dataset has the necessary columns (hdi and phdi)\nif(!all(c(\"iso3c\", \"hdi\", \"phdi\") %in% colnames(planetaryhdi))) {\n  stop(\"planetaryhdi must have columns 'hdi' and 'phdi'.\")\n}\n\n# Create the scatter plot\nggplot(planetaryhdi, aes(x = hdi, y = phdi, label = iso3c)) +\n  geom_point(aes(color = phdi), size = 1) +  # Points colored by phdi values\n  geom_text(aes(label = iso3c), hjust = 1.5, vjust = 1.5, size = 1.5) +  # Labels for countries\n  theme_minimal() +\n  labs(title = \"HDI vs Planetary Pressures Adjusted HDI (2022)\",\n       x = \"Human Development Index (HDI)\",\n       y = \"Planetary Pressures Adjusted HDI (phdi)\") +\n  theme(axis.text = element_text(size = 10),  # Adjust axis text size\n        axis.title = element_text(size = 12),  # Adjust axis title size\n        legend.position = \"none\")  # Remove the legend\n\n```\n\n## License\n\nData are available as\n[CC-BY](https://github.com/openwashdata/%7B%7B%7Bpackagename%7D%7D%7D/blob/main/LICENSE.md).\n\n## Citation\n\nPlease cite this package using:\n\n```{r}\ncitation(\"planetaryhdi\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwashdata%2Fplanetaryhdi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenwashdata%2Fplanetaryhdi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwashdata%2Fplanetaryhdi/lists"}