Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(readxl)
- setwd("~/Dropbox/Misc/Statistics/mindenfele/data/Europe_economy_history")
- datfile <- "Maddison_Europe_Full.xlsx"
- excel_sheets(datfile)
- gdppc <- read_excel(datfile,sheet = 4,skip=2)
- names(gdppc)[1] <- 'year'
- # Drop data <1820 and >2009
- gdppc <- gdppc[61:199,]
- gdppc.xts <- xts(gdppc[,-1],as.Date(paste0(gdppc$year,'-01-01')))
- gdppc.zoo <- as.zoo(gdppc.xts)
- tsRainbow <- rainbow(20)
- plot(gdppc.zoo[,1:20],col = tsRainbow,screens=1,
- main = "gdppculation of European countries",
- xlab="Year",
- ylab="gdppculation [thousands]",
- xlim = c(as.Date("1900-01-01"),as.Date("2009-01-01")))
- legend(x = "topleft", legend = names(gdppc.zoo)[1:20],
- lty = 1,col = tsRainbow,cex=0.6)
- compara <- gdppc[,c(1,21,2,7,13,5)]
- compara <- compara[77:139,]
- plot(compara$year,compara$`Hungary `,type="l",
- ylim = c(1000,25000),
- main="GPD/capita of selected countries after WWII",
- sub="plot labels reflect events in Hungary",
- xlab="year",
- ylab="USD",las=1)
- lines(compara$year,compara$`Germany `,col="blue")
- lines(compara$year,compara$`Austria `,col="green")
- lines(compara$year,compara$UK,col="red")
- lines(compara$year,compara$`Finland `,col="orange")
- lines(c(1956,1956),c(30,15000))
- lines(c(1990,1990),c(30,15000))
- text(1950,650,"Stalinism")
- text(1972,1440,"Socialism\nKádár regime")
- text(1956,20000,"'56 uprising",srt=90)
- text(1990,21000,"political transition",srt=90)
- legend(1960,25000,c("Hungary","Austria","Germany","Finland","UK"),
- bty="n",
- lty=1,
- col=c("black","green","blue","orange","red"))
- plot(compara$year,100*compara$`Hungary `/compara$`Hungary `[1],type="l",
- ylim = c(90,1200),
- main="GPD/capita of selected countries after WWII\nin % of 1945 value",
- sub="plot labels reflect events in Hungary",
- xlab="year",
- ylab="USD",las=1)
- lines(compara$year,100*compara$`Germany `/compara$`Germany `[1],col="blue")
- lines(compara$year,100*compara$`Austria `/compara$`Austria `[1],col="green")
- lines(compara$year,100*compara$UK/compara$UK[1],col="red")
- lines(compara$year,100*compara$`Finland `/compara$`Finland `[1],col="orange")
- lines(c(1956,1956),c(50,600))
- text(1956,800,"'56 uprising",srt=90)
- lines(c(1990,1990),c(50,600))
- text(1990,880,"political transition",srt=90)
- text(1950,400,"Stalinism")
- text(1972,420,"Socialism\nKádár regime")
- legend(1960,1200,c("Hungary","Austria","Germany","Finland","UK"),
- bty="n",
- lty=1,
- col=c("black","green","blue","orange","red"))
- compara$AH <- 100*compara$`Hungary `/compara$`Austria `
- plot(compara$year,compara$AH,type='l',
- main="Hungary's GDP/capita as percent of Austria's after WWII",
- sub="plot labels reflect events in Hungary",
- xlab="year",
- ylab="%", las=1)
- #abline(v=1990)
- lines(c(1956,1956),c(31,65))
- lines(c(1990,1990),c(31,65))
- text(1950,35,"Stalinism")
- text(1972,34,"Socialism\nKádár regime")
- text(1956,75,"'56 uprising",srt=90)
- text(1990,76,"political transition",srt=90)
- arrows(1968,70,1974.5,70,length=0.15,code=3)
- text(1971.5,80,"New\nEconomical\nMechanism")
- arrows(1975,70,1985,70,length=0.15,code=3)
- text(1980,80,"Fekete's\nEconomy")
- arrows(1973,60,2010,60,length=0.15)
- text(1992,57,"External financing of Hungarian economy")
- # After Trianon, before the end of WWII
- compara2 <- gdppc[!is.na(gdppc$`Hungary `),c(1,21,2,7,13,5)]
- compara2 <- compara2[6:25,]
- plot(compara2$year,compara2$`Hungary `,type="l",
- ylim = c(1500,8000),
- main="GPD/capita of selected countries before the end of WWII",
- xlab="year",
- ylab="USD",las=1)
- lines(compara2$year,compara2$`Germany `,col="blue")
- lines(compara2$year,compara2$`Austria `,col="green")
- lines(compara2$year,compara2$UK,col="red")
- lines(compara2$year,compara2$`Finland `,col="orange")
- legend(1922,8000,c("Hungary","Austria","Germany","Finland","UK"),
- bty="n",
- lty=1,
- col=c("black","green","blue","orange","red"))
- arrows(1929,6000,1932,6000,length=0.15,code=3)
- text(1930.5,6300,"The great depression")
- plot(compara2$year,100*compara2$`Hungary `/compara2$`Hungary `[1],type="l",
- ylim = c(90,210),
- main="GPD/capita of selected countries before the end of WWII",
- sub="in % of 1920 value",
- xlab="year",
- ylab="%",las=1)
- lines(compara2$year,100*compara2$`Germany `/compara2$`Germany `[1],col="blue")
- lines(compara2$year,100*compara2$`Austria `/compara2$`Austria `[1],col="green")
- lines(compara2$year,100*compara2$UK/compara2$UK[1],col="red")
- lines(compara2$year,100*compara2$`Finland `/compara2$`Finland `[1],col="orange")
- legend(1922,210,c("Hungary","Austria","Germany","Finland","UK"),
- bty="n",
- lty=1,
- col=c("black","green","blue","orange","red"))
- arrows(1929,180,1932,180,length=0.15,code=3)
- text(1930.5,190,"The great depression")
- compara2$AH <- 100*compara2$`Hungary `/compara2$`Austria `
- plot(compara2$year,compara2$AH,type='l',
- main="Hungary's GDP/capita as percent of Austria's before the end of WWII",
- sub="plot labels reflect events in Hungary",
- xlab="year",
- ylab="%", las=1)
- arrows(1929,85,1932,85,length=0.15,code=3)
- text(1930.5,87,"The great depression")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement