I want to create a bar-plot with geom_text()
. Above every bar should be the count of the variable. But in this case the position of the text is in the middle of the barplot.
Can someone help me to solve this problem?
new.data <- diamonds[ which( diamonds$clarity =="VS1" | diamonds$clarity =="VS2") , ]
ggplot(data=new.data, aes(x=clarity, fill=cut)) +
geom_bar(position = "dodge",stat = "count") +
geom_text(stat='count', aes(label=..count..), vjust=-1)