Created
January 29, 2013 14:20
-
-
Save floswald/4664577 to your computer and use it in GitHub Desktop.
country plot code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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