I'm trying to create a bar chart of proportions with value labels for each bar and different bar colors. Right now here's what I have
library(tidyverse) ggplot(data = mpg, mapping = aes(x = factor(cyl), fill = factor(cyl))) + geom_bar() + geom_text(mapping = aes(label = ..prop.., group=1), stat = "count", vjust=-.5)
When I run this code it sort of gives me almost everything I want, except that I can't, however, seem to figure out how to change the y-axis to show proportion instead of count. I appreciate any suggestion. Thanks!