library(ggplot2)
df = data.frame(subject <- c('ADA','ADA','ADA','CN','CN','CN','PDS','PDS','PDS','CPDP',
'CPDP','CPDP'),
credit <- c('Midsem','Viva','Attendance','Midsem','Viva','Attendance',
'Midsem','Viva','Attendance','Midsem','Viva','Attendance'),
value <- c(50,30,20,40,40,20,50,35,15,50,40,10))
df$subject <- factor(df$subject)
df$credit <- factor(df$credit)
ggplot(data=df, aes(x=" ", y=value, group=credit, colour=credit, fill=credit)) +
geom_bar(width = 1, stat = "identity") +
coord_polar("y", start=0) +
facet_grid(.~ subject) +theme_void()