I have the following dataset
prg<-c('BRK1','BRK2','MAN1','QN')
comp<-c(5,0,12,9)
reg<-c(0,5,0,0)
term<-c(3,0,0,0)
df<-data.frame(prg,comp,reg,term)
df
prg comp reg term
1 BRK1 5 0 3
2 BRK2 0 5 0
3 MAN1 12 0 0
4 QN 9 0 0
Basically, I want to draw a barplot using ggplplot
where prg
is on the x axis and there are three bars for each of the prg
in the form of comp
reg
and term
representing the corresponding counts.
How can I go about doing this?