Syndicate content

R

Interactive product export streamgraphs with data360r (now in CRAN!)

Reg Onglao's picture

Building beautiful, interactive charts is becoming easier nowadays in R, especially with open source packages such as plot.ly, ggplot2 and leaflet. But behind the scenes, there is an often untold, gruesome part of creating data visualizations -- downloading, cleaning, and processing data into the correct format.

Making data access and download easier is one of the reasons we developed data360r, recently available on CRAN and the newest addition to the TCdata360 Data Science Corner.

Data360r is a nifty R wrapper for the TCdata360 API, where R users ranging from beginners to experts can easily download trade and competitiveness data, metadata, and resources found in TCdata360 using single-line R functions.

In an earlier blog, we outlined some benefits of using data360r. In this blog, we’ll show you how to make an interactive streamgraph using the data360r and streamgraph packages in just a few lines of code! For more usecases and tips, go to https://tcdata360.worldbank.org/tools/data360r.

Introducing Data360R — data to the power of R

Reg Onglao's picture
 

Last January 2017, the World Bank launched TCdata360 (tcdata360.worldbank.org/), a new open data platform that features more than 2,000 trade and competitiveness indicators from 40+ data sources inside and outside the World Bank Group. Users of the website can compare countries, download raw data, create and share data visualizations on social media, get country snapshots and thematic reports, read data stories, connect through an application programming interface (API), and more.

Things to do with Trade and Competitiveness Data… thank you API

Alberto Sanchez Rodelgo's picture

Who are Spain's neighbors? Is Canada closer to Spain than Portugal? What about Estonia or Greece? The answer? Depends on the data you are looking at!

Earlier this week I crunched data based on a selected list of indicators from the new Open Trade and Competitiveness platform from the World Bank (TCdata360) and found some interesting trends[1]. In 2009 Spain was closer to economies like Estonia, Belgium, France and Canada while 6 years later in 2015, Spain's closest neighbors were Greece and Portugal. How and when did this shift happen?

Other trends I spotted using the same data? It seems the Sub-Saharan region ranks the lowest in Ease of Doing Business, that in 2007 Israel held the record for R&D expenditure as % of GDP, while in the same year Malta topped FDI net inflows as % GDP, and that the largest annual GDP growth in the last 20 years occurred in Equatorial Guinea in 1997.

Figure 1: Dots represent values for an economy at a given point in time for years 1996 to 2016 overlaying their box-plot distributions. Colors correspond to geographical regions.