I'm trying to make a lollipop plot (with geom_segment and geom_point) similar to a bar plot but my Y is count instead of a provided variable from dataset and I can't find anywhere how to do this.
My code:
data %>%
ggplot(aes(x=x)) +
geom_point(stat="count") +
geom_segment(aes(xend=x, y=0, yend=..count..))
How do I specify correctly the yend value? Geom_point alone seems to be working just fine. I believe I don't understand the correct use of ..count.. within ggplot.