March 29, 2018

Objective

To compare the GDP growth of Hong Kong, Indonesia, Malaysia and Singapore from 1970 to 2016.

Drawing data from the World Bank, a chart is created using plotly to trace the GDP growth of these countries.

Chart

Insights from Chart

From the chart, we see that Indonesia has seen an exponential growth in GDP since 2000.

On the other hand, Malaysia and Singapore have caught up with Hong Kong in GDP since 2009.

R Code

The R Code for plotting the chart is as follows:

plot_ly(gdpdata, x = ~Year, y = ~HongKong, name='Hong Kong',
        type = 'scatter', mode = 'lines')%>%
  add_trace(y = ~Indonesia, name = 'Indonesia', mode = 'lines') %>%
  add_trace(y = ~Malaysia, name = 'Malaysia', mode = 'lines')%>%
  add_trace(y = ~Singapore, name = 'Singapore', mode = 'lines')%>%
  layout(title = "GDP Comparison, 1970-2016",
         xaxis = list(title = "Year"),
         yaxis = list (title = "GDP (current US$)"))