library(openxlsx) library(ggplot2) library(gridExtra) sample1<-read.xlsx("http://kanggc.iptime.org/book/data/stat-1.xlsx") mid<-sample1$mid final<-sample1$final total<-sample1$total grade<-sample1$grade plot1<-ggplot(data=sample1, aes(x=1, y=mid)) + geom_boxplot() + ggtitle("Boxplot of Mid")+ theme(plot.title = element_text(hjust = 0.5)) plot2<-ggplot(data=sample1, aes(x=1, y=final)) + geom_boxplot() + ggtitle("Boxplot of Final")+ theme(plot.title = element_text(hjust = 0.5)) plot3<-ggplot(data=sample1, aes(x=1, y=total)) + geom_boxplot() + ggtitle("Boxplot of Total")+ theme(plot.title = element_text(hjust = 0.5)) marrangeGrob(grobs=list(plot1, plot2, plot3), nrow=1, ncol=3) t.grade<-data.frame(table(sample1$grade)) plot4<-ggplot(t.grade, aes(x="", y=Freq, fill=Var1)) + geom_bar(width=1, stat="identity") + coord_polar(theta="y") + ggtitle("Pie Chart of Total Score")+ theme(plot.title = element_text(hjust = 0.5)) marrangeGrob(grobs=list(plot4), nrow=1, ncol=1) plot5<-ggplot(data=sample1, aes(x=grade)) + geom_bar() + ggtitle("Bar Chart of Grade")+ theme(plot.title = element_text(hjust = 0.5)) marrangeGrob(grobs=list(plot5), nrow=1, ncol=1)