All Projects → gshs-ornl → wbstats

gshs-ornl / wbstats

Licence: other
wbstats: An R package for searching and downloading data from the World Bank API

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to wbstats

cia
Citizen Intelligence Agency, open-source intelligence (OSINT) project
Stars: ✭ 79 (-25.47%)
Mutual labels:  open-data, worldbank
MADBike
This is the public repository of the MADBike app for iOS. Public bike rental service for BiciMAD.
Stars: ✭ 23 (-78.3%)
Mutual labels:  open-data
Data Curator
Data Curator - share usable open data
Stars: ✭ 199 (+87.74%)
Mutual labels:  open-data
openpolice
OpenPolice empowers people to prepare, file, and track police misconduct complaints. By allowing users to publish reports online, we aim to establish an independent and transparent repository of police activity in the U.S.
Stars: ✭ 24 (-77.36%)
Mutual labels:  open-data
Graphql Camara Deputados
API GraphQL com os dados da câmara de deputados do Brasil
Stars: ✭ 204 (+92.45%)
Mutual labels:  open-data
data.world-r
R library for data.world
Stars: ✭ 59 (-44.34%)
Mutual labels:  open-data
Catalogos Dados Brasil
Mapeamento de iniciativas (e catálogos) de dados abertos governamentais no Brasil.
Stars: ✭ 187 (+76.42%)
Mutual labels:  open-data
berlin-open-source-portal
Showcase of Open Source Software that is built, maintained and/or funded by Berlin state governmental agencies
Stars: ✭ 21 (-80.19%)
Mutual labels:  open-data
digipathos
Brazilian Agricultural Research Corporation (EMBRAPA) fully annotated dataset for plant diseases. Plug and play installation over PiP.
Stars: ✭ 38 (-64.15%)
Mutual labels:  open-data
Common Voice
Common Voice is part of Mozilla's initiative to help teach machines how real people speak.
Stars: ✭ 2,891 (+2627.36%)
Mutual labels:  open-data
Covid 19 Repo Data
Data archive of identifiable COVID-19 related public projects on GitHub
Stars: ✭ 236 (+122.64%)
Mutual labels:  open-data
Scihub
Source code and data analyses for the Sci-Hub Coverage Study
Stars: ✭ 205 (+93.4%)
Mutual labels:  open-data
LDWizard
A generic framework for simplifying the creation of linked data.
Stars: ✭ 17 (-83.96%)
Mutual labels:  open-data
Pudl
The Public Utility Data Liberation Project
Stars: ✭ 200 (+88.68%)
Mutual labels:  open-data
patzilla
PatZilla is a modular patent information research platform and data integration toolkit with a modern user interface and access to multiple data sources.
Stars: ✭ 71 (-33.02%)
Mutual labels:  open-data
Magda
A federated, open-source data catalog for all your big data and small data
Stars: ✭ 193 (+82.08%)
Mutual labels:  open-data
City Scrapers
Scrape, standardize and share public meetings from local government websites
Stars: ✭ 220 (+107.55%)
Mutual labels:  open-data
open-data-covid-19
Open Data Repository for the Covid-19 dataset.
Stars: ✭ 19 (-82.08%)
Mutual labels:  open-data
CityScoreToolkit
Open-source version of Boston's CityScore performance dashboard
Stars: ✭ 42 (-60.38%)
Mutual labels:  open-data
openSenseMap-API
API for opensensemap.org
Stars: ✭ 46 (-56.6%)
Mutual labels:  open-data

wbstats: An R package for searching and downloading data from the World Bank API

CRAN status Monthly Lifecycle: maturing

You can install:

The latest release version from CRAN with

install.packages("wbstats")

or

The latest development version from github with

remotes::install_github("nset-ornl/wbstats")

Downloading data from the World Bank

library(wbstats)

# Population for every country from 1960 until present
d <- wb_data("SP.POP.TOTL")
    
head(d)
#> # A tibble: 6 x 9
#>   iso2c iso3c country    date SP.POP.TOTL unit  obs_status footnote last_updated
#>   <chr> <chr> <chr>     <dbl>       <dbl> <chr> <chr>      <chr>    <date>      
#> 1 AF    AFG   Afghanis~  2019    38041754 <NA>  <NA>       <NA>     2020-07-01  
#> 2 AF    AFG   Afghanis~  2018    37172386 <NA>  <NA>       <NA>     2020-07-01  
#> 3 AF    AFG   Afghanis~  2017    36296400 <NA>  <NA>       <NA>     2020-07-01  
#> 4 AF    AFG   Afghanis~  2016    35383128 <NA>  <NA>       <NA>     2020-07-01  
#> 5 AF    AFG   Afghanis~  2015    34413603 <NA>  <NA>       <NA>     2020-07-01  
#> 6 AF    AFG   Afghanis~  2014    33370794 <NA>  <NA>       <NA>     2020-07-01

Hans Rosling’s Gapminder using wbstats

library(tidyverse)
library(wbstats)

my_indicators <- c(
  life_exp = "SP.DYN.LE00.IN", 
  gdp_capita ="NY.GDP.PCAP.CD", 
  pop = "SP.POP.TOTL"
  )

d <- wb_data(my_indicators, start_date = 2016)

d %>%
  left_join(wb_countries(), "iso3c") %>%
  ggplot() +
  geom_point(
    aes(
      x = gdp_capita, 
      y = life_exp, 
      size = pop, 
      color = region
      )
    ) +
  scale_x_continuous(
    labels = scales::dollar_format(),
    breaks = scales::log_breaks(n = 10)
    ) +
  coord_trans(x = 'log10') +
  scale_size_continuous(
    labels = scales::number_format(scale = 1/1e6, suffix = "m"),
    breaks = seq(1e8,1e9, 2e8),
    range = c(1,20)
    ) +
  theme_minimal() +
  labs(
    title = "An Example of Hans Rosling's Gapminder using wbstats",
    x = "GDP per Capita (log scale)",
    y = "Life Expectancy at Birth",
    size = "Population",
    color = NULL,
    caption = "Source: World Bank"
  ) 

Using ggplot2 to map wbstats data

library(rnaturalearth)
library(tidyverse)
library(wbstats)

ind <- "SL.EMP.SELF.ZS"
indicator_info <- filter(wb_cachelist$indicators, indicator_id == ind)

ne_countries(returnclass = "sf") %>%
  left_join(
    wb_data(
      c(self_employed = ind), 
         mrnev = 1
          ),
    c("iso_a3" = "iso3c")
  ) %>%
  filter(iso_a3 != "ATA") %>% # remove Antarctica
  ggplot(aes(fill = self_employed)) +
  geom_sf() +
  scale_fill_viridis_c(labels = scales::percent_format(scale = 1)) +
  theme(legend.position="bottom") +
  labs(
    title = indicator_info$indicator,
    fill = NULL,
    caption = paste("Source:", indicator_info$source_org) 
  )

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].