#install.packages("gridExtra") # in der Konsole library(gridExtra) library(ggplot2) # Gebäudeschaden hist1 <- ggplot(data, aes(SchGeb)) + geom_histogram(binwidth=0.1, color="black", fill="lightgrey") + theme_bw() + labs(title="Histogramm - SchGeb", y="absolute Haeufigkeit") box1 <- ggplot(data, aes(y=SchGeb)) + geom_boxplot(fill="lightgrey", size=0.5) + theme_bw() + theme(axis.text.x=element_blank(), axis.ticks.x=element_blank())+ xlim(-1, 1) + labs(title="Boxplot - SchGeb") # Hausratschaden hist2 <- ggplot(data, aes(SchHr)) + geom_histogram(binwidth=0.1, color="black", fill="lightgrey") + theme_bw() + labs(title="Histogramm - SchHr", y="absolute Haeufigkeit") box2 <- ggplot(data, aes(y=SchHr)) + geom_boxplot(fill="lightgrey", size=0.5) + theme_bw() + theme(axis.text.x=element_blank(), axis.ticks.x=element_blank())+ xlim(-1, 1) + labs(title="Boxplot - SchHr") grid.arrange(hist1, hist2, box1, box2, ncol=2, heights=c(1,1.25))