Skip to content

Instantly share code, notes, and snippets.

@floswald
Created January 29, 2013 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save floswald/4664577 to your computer and use it in GitHub Desktop.
Save floswald/4664577 to your computer and use it in GitHub Desktop.
country plot code
library(xlsx)
cdat <- read.xlsx(file="~/datasets/ReinhardRogoff/18_data.xls",sheetName="Aut.Ita.UK.US")
cdat <- cdat[,-c(5,6,7)]
library(reshape)
library(ggplot2)
m <- melt(cdat,c("Year","Country"))
p <- ggplot(m,aes(x=Year,y=value)) + geom_line(aes(color=variable),size=1) + facet_wrap(~Country,ncol=1) + scale_y_continuous(name="Public (Public and Private) debt to GDP (GNP) ratios") + theme(legend.position="top")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment