Shiny App: World Trade Organization Statistics

http://carlosmirandad.shinyapps.io/DEPLOY/
Final Project for the Developing Data Products Coursera Class

Why do we need this app?

The World Trade Organization (WTO) is the global institution that orchestrates rules of trade between nations, in order to ensure that international trade flows as smoothly, predictably, and freely as possible.

As part of its functions, the WTO collects data about import and exports from all member countries and consolidates this information in a statistical database that can be accessed by policy makers and the public.

The WTO's website presents this fascinating information in a table format which can make the analysis challenging...
Behold analysit! Our new Shiny App comes to the rescue...

What does this App offer?

  • This Shiny App has the import & export data for all countries in the world, from 2006 to 1013, classified by commodity type.
  • Information is presented visually to help the user compare various countries and comodities at different points of time.

Image

Go to: http://carlosmirandad.shinyapps.io/DEPLOY/

How to Use It?

  1. Select a year (moving the slider)
  2. Select commodities (checking/unchecking the boxes)
  3. Add or remove countries (typing country names in the box)
  4. A comparison report of Export & Import values by country will appear in the right pane

Image

How Does it Work? (Real R Code Run)

Sample application code (with edits) that plots the export chart:

#Simulated User Inputs...
yr <- 2012
ctry <- c("United States","Saudi Arabia","Germany","India","Brazil","China","Colombia")
comm <- c("A","F","M")
#Plotting the "Export Chart"...
dExp <- d[d$Year==yr & d$Reporting_Country %in% ctry & d$Commodity %in% comm & d$Flow=="Exports",]
qplot(x=Reporting_Country, y=Value, fill=Commodity_Type, data=dExp, main=paste("Reported Exports for Year",as.character(yr)), xlab="", ylab="Total Export Value (US$ Million)", geom="bar", stat="identity", position="dodge")

plot of chunk unnamed-chunk-2