I\'m trying to create a bar plot with ggplot2, showing counts on the y axis, but also the percents of total on top of each bar. I\'ve calculated the counts and percents of t
library(dplyr) library(ggplot2) df1 = iris %>% group_by(Species) %>% summarize(count = n()) %>% mutate(percent = count/sum(count)) ggplot(data = df1, aes(x = Species, y = count, label = paste0(round(percent,2),"%"))) + geom_bar(stat="identity") + geom_text(aes(y = count*1.1))