ggplot(data = hotel_bookings) +
geom_bar(mapping = aes(x = hotel, fill = market_segment)) +
geom_text(aes(label = "Online TA", count, ""),y = 5)
Error: Aesthetics must be valid data columns. Problematic aesthetic(s): x = count.
Did you mistype the name of a data column or forget to add after_stat()?
Run rlang::last_error()
to see where the error occurred.
I've tried about 30 different ways to do this and I can't seem to get a label inside the stacked bar graph.
ggplot(data = hotel_bookings) + geom_bar(mapping = aes(x = hotel, fill = market_segment))
This is the bar graph I was working with, and I thought I'd be able to easily add the "count" quantities to the bars. With the stacked look of it, it's hard to tell what the quantities are and I think it would make analysis easier to have quantities labeled inside the bars. How do I do this? I'm working through the coursera Google Analytics program and, although it's not a part of my current lesson, it would be helpful to know. Thanks for the help in advance.
I have also just tried the code: geom_text(aes(label=count)), and geom_text(aes(label = "count")), as well as geom_text(label='count')...many iterations of this. Nothing seems to add the "count" value into label form. The other puzzling aspect is that I've had an error message saying it needed a value for the y-axis, but in this geom_bar() graph there was no y value, it was the default count value, totaling up the values of the x-axis' values. If that makes sense...just more clarity on my issue. Please help.