Advertisement
hd1

hd1/20150417

hd1
Apr 17th, 2015
936
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.47 KB | None | 0 0
  1. library(ggplot2)
  2. library(imguR)
  3. library(WDI)
  4. WDI(indicator='NY.GDP.MKTP.KD.ZG') -> gdp
  5. gdp[(gdp$iso2c == 'DE' | gdp$iso2c == 'US'|gdp$country == 'China'),] -> gdp.study
  6. tempfile(fileext='.png') -> outF
  7. gdp.study.plot <- ggplot(gdp.study, aes(x=year, y=NY.GDP.MKTP.KD.ZG, fill=country)) + geom_bar(stat='identity') + ggtitle('Contribution to GDP growth, unweighted') + ylab('Growth rate') + xlab('Year')
  8. ggsave(outF, gdp.study.plot)
  9. upload_image(outF[[1]])
  10. unlink(outF)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement