Skip to content

Instantly share code, notes, and snippets.

@tkb
Last active January 2, 2017 05:44
Show Gist options
  • Save tkb/6041457 to your computer and use it in GitHub Desktop.
Save tkb/6041457 to your computer and use it in GitHub Desktop.
library(WDI)
library(ggplot2)
#Grab GNI per capita data for Chile, Hungary and Uruguay
dat = WDI(indicator='NY.GNP.PCAP.CD', country=c('CL','HU','UY'), start=1960, end=2012)
#a quick plot with legend, title and lable
ggplot(dat, aes(year, NY.GNP.PCAP.CD, color=country)) + geom_line()
+ xlab('Year') + ylab('GDI per capita (Atlas Method USD)')
+ labs(title = "GNI Per Capita ($USD Atlas Method)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment