paper.R

library(ggplot2)
library(gridExtra)

F=read.csv("PLOSONE2013Data.csv")
CY=(F$CYNewWorldOrder+F$CYMLK+F$CYMoon+F$CYJFK+F$CY911+F$CYDiana)/6
CLIM=(F$CNatFluct+F$CdueGHG+F$CseriousDamage+F$CO2causesCC+F$HumansInsign)/5
LGO13=data.frame(cbind(CLIM,CY))

figa=ggplot(data = LGO13, aes(x=CY,y=CLIM)) + geom_point(size=0.8,position = position_jitter(w = 0.05, h = 0.05)) + geom_smooth(method="loess")
figb=ggplot(data = LGO13, aes(x=CLIM,y=CY)) + geom_point(size=0.8,position = position_jitter(w = 0.05, h = 0.05)) + geom_smooth(method="loess")

png("fig1.png",width=4000,height=2000,res=600)
grid.arrange(figa,figb, ncol=2, nrow=1)
dev.off()

Back to list of R-files

Advertisements