df <- data.frame(x=c("A","C","D","A","A","B","C","D"), g=c("G1","G1","G1","G2","G3","G3","G3","G3"))
g <- ggplot(df, aes(x))
g + geom_bar() + geom_text(aes(y=g, label=g), vjust=-1)
The y axis labels are showing the group numbers instead of counts. I would also like to plot the text just above each bar without the huge gap between groups, for example for the first bar:
G3
G2
G1
Is there a way I can fix these two points?