I have this dataset
month = c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
Purchase = c(110,120,60,84,66,92,32,53,77,100,48,79)
Sales = c(90,120,80,64,69,98,41,39,65,98,57,69)
df = data.frame(month, Purchase, Sales)
I want to have a grouped barplot of month vs Purchase and Sales. Basically x axis should be Month and Y axis should be count and in the barplot, I need to have Purchase and Sales grouped next to each other per month.
#Code for single plot
ggplot(data=df,aes(y=Purchase, x=month)) + geom_bar(stat = "identity")
#But when I do this, the plot is not correct.
ggplot(data=df,aes(y=Purchase, x=month,fill=Sales)) + geom_bar(stat="identity", position = "dodge")