{"id":45104918,"url":"https://github.com/gshs-ornl/wbstats","last_synced_at":"2026-02-19T21:58:24.370Z","repository":{"id":44872897,"uuid":"56796130","full_name":"gshs-ornl/wbstats","owner":"gshs-ornl","description":"wbstats: An R package for searching and downloading data from the World Bank API","archived":false,"fork":false,"pushed_at":"2023-12-02T12:40:47.000Z","size":14706,"stargazers_count":131,"open_issues_count":18,"forks_count":24,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-01-27T03:55:08.551Z","etag":null,"topics":["open-data","r","r-package","rstats","world-bank","world-bank-api","worldbank"],"latest_commit_sha":null,"homepage":"http://gshs-ornl.github.io/wbstats/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gshs-ornl.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-21T18:19:07.000Z","updated_at":"2025-12-23T11:58:38.000Z","dependencies_parsed_at":"2024-06-21T20:23:01.883Z","dependency_job_id":"ed66becc-af52-445f-87b5-502db6114cd4","html_url":"https://github.com/gshs-ornl/wbstats","commit_stats":{"total_commits":138,"total_committers":4,"mean_commits":34.5,"dds":0.07246376811594202,"last_synced_commit":"8cf030bd6b26f92bb34a1df3cd7c2d7314fc63df"},"previous_names":["nset-ornl/wbstats"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gshs-ornl/wbstats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gshs-ornl%2Fwbstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gshs-ornl%2Fwbstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gshs-ornl%2Fwbstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gshs-ornl%2Fwbstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gshs-ornl","download_url":"https://codeload.github.com/gshs-ornl/wbstats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gshs-ornl%2Fwbstats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29634573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T18:02:07.722Z","status":"ssl_error","status_checked_at":"2026-02-19T18:01:46.144Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["open-data","r","r-package","rstats","world-bank","world-bank-api","worldbank"],"created_at":"2026-02-19T21:58:23.864Z","updated_at":"2026-02-19T21:58:24.365Z","avatar_url":"https://github.com/gshs-ornl.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput:\n  md_document:\n    variant: markdown_github\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/\"\n)\n```\n\n# wbstats: An R package for searching and downloading data from the World Bank API\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/wbstats)](https://CRAN.R-project.org/package=wbstats)\n[![Monthly](https://cranlogs.r-pkg.org/badges/wbstats)](https://CRAN.R-project.org/package=wbstats)\n[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)\n\u003c!-- badges: end --\u003e\n\nYou can install:\n\nThe latest release version from CRAN with\n```{r, eval = FALSE}\ninstall.packages(\"wbstats\")\n```\n\nor\n\nThe latest development version from github with\n```{r, eval = FALSE}\nremotes::install_github(\"nset-ornl/wbstats\")\n```\n\n# Downloading data from the World Bank\n\n```{r readme-download, warning=FALSE}\nlibrary(wbstats)\n\n# Population for every country from 1960 until present\nd \u003c- wb_data(\"SP.POP.TOTL\")\n    \nhead(d)\n```\n\n\n## Hans Rosling's Gapminder using `wbstats`\n\n```{r readme-chart, warning=FALSE, message=FALSE, fig.width=12, fig.height=6}\nlibrary(tidyverse)\nlibrary(wbstats)\n\nmy_indicators \u003c- c(\n  life_exp = \"SP.DYN.LE00.IN\", \n  gdp_capita =\"NY.GDP.PCAP.CD\", \n  pop = \"SP.POP.TOTL\"\n  )\n\nd \u003c- wb_data(my_indicators, start_date = 2016)\n\nd %\u003e%\n  left_join(wb_countries(), \"iso3c\") %\u003e%\n  ggplot() +\n  geom_point(\n    aes(\n      x = gdp_capita, \n      y = life_exp, \n      size = pop, \n      color = region\n      )\n    ) +\n  scale_x_continuous(\n    labels = scales::dollar_format(),\n    breaks = scales::log_breaks(n = 10)\n    ) +\n  coord_trans(x = 'log10') +\n  scale_size_continuous(\n    labels = scales::number_format(scale = 1/1e6, suffix = \"m\"),\n    breaks = seq(1e8,1e9, 2e8),\n    range = c(1,20)\n    ) +\n  theme_minimal() +\n  labs(\n    title = \"An Example of Hans Rosling's Gapminder using wbstats\",\n    x = \"GDP per Capita (log scale)\",\n    y = \"Life Expectancy at Birth\",\n    size = \"Population\",\n    color = NULL,\n    caption = \"Source: World Bank\"\n  ) \n    \n```\n\n\n\n## Using `ggplot2` to map `wbstats` data\n\n```{r ggplot2, fig.height=6, fig.width=8, fig.align=\"center\", message=FALSE, warning=FALSE}\nlibrary(rnaturalearth)\nlibrary(tidyverse)\nlibrary(wbstats)\n\nind \u003c- \"SL.EMP.SELF.ZS\"\nindicator_info \u003c- filter(wb_cachelist$indicators, indicator_id == ind)\n\nne_countries(returnclass = \"sf\") %\u003e%\n  left_join(\n    wb_data(\n      c(self_employed = ind), \n         mrnev = 1\n          ),\n    c(\"iso_a3\" = \"iso3c\")\n  ) %\u003e%\n  filter(iso_a3 != \"ATA\") %\u003e% # remove Antarctica\n  ggplot(aes(fill = self_employed)) +\n  geom_sf() +\n  scale_fill_viridis_c(labels = scales::percent_format(scale = 1)) +\n  theme(legend.position=\"bottom\") +\n  labs(\n    title = indicator_info$indicator,\n    fill = NULL,\n    caption = paste(\"Source:\", indicator_info$source_org) \n  )\n  \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgshs-ornl%2Fwbstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgshs-ornl%2Fwbstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgshs-ornl%2Fwbstats/lists"}