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 t.grade<-data.frame(table(sample1$grade)) plot1<-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(plot1),nrow=1, ncol=1)