document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  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)
');