So I'm new to R and already checked countless Stack Overflow threads and youtube videos but cant figure out how to do this simple taks. I have a stacked bar graph and wanted to labels on top of each bar for the various values counted.
Here's the basic code:
ggplot(data=cyclist_data2) +
geom_bar(mapping = aes(x=member_casual, fill=rideable_type))
And the consequent graph:
I've tried adding a geom_text
function that I saw in a video but it didn't work:
ggplot(data=cyclist_data2, mapping=aes(x=member_casual, y=rideable_type)) +
geom_bar(stat = 'identity') +
geom_text(aes(label = rideable_type), vjust = -0.2, colour = black, size = 5)
Help would be appreciated!