Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ggplot2)
- library(imguR)
- library(WDI)
- WDI(indicator='NY.GDP.MKTP.KD.ZG') -> gdp
- gdp[(gdp$iso2c == 'DE' | gdp$iso2c == 'US'|gdp$country == 'China'),] -> gdp.study
- tempfile(fileext='.png') -> outF
- 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')
- ggsave(outF, gdp.study.plot)
- upload_image(outF[[1]])
- unlink(outF)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement