I'm trying to make a grouped bar chart in R using ggplot2. Code I'm using for that is:
ggplot(loanData, aes(factor(loanData$saving_status), <Y AXIS ATTRIBUTE>, fill = loanData$class)) + geom_bar(stat="identity", position = "dodge") + scale_fill_brewer(palette = "Set1")
However, I don't know what should I replace "Y AXIS ATTRIBUTE" with in order to indicate number of occurrences for values of saving_status and class attributes on the chart. I guess what I need is to count those occurrences using some method and put the result there?
Basically what I'm looking for is something like answer to this question but I don't have value in my table I could use in the same way as "species" is used in that example. Thank you