I need display the percentage value on the bars of a bar chart in R.
This code plots categorical data, with the categories on x and % on y. How to modify it such that it displays the percentage on the bars themselves, not just on the y-axis?
ggplot(data = iris) +
geom_bar(mapping = aes(x = Species, y = (..count..)/sum(..count..), fill = Species)) +
scale_y_continuous(labels = percent)