0

I I hope you can assist me. I write a code that shows a bar chart in R. I want to add a data label to the bars, but when I add the geom_text code, it doesn't show me the graph.

Do you have any idea how to solve this? And also that the thousands of numbers will be with,

Thank you!

    p<-ggplot(DATA.df, aes(x=sentiment))+
  geom_bar(stat="count", width=0.6, color=c('red', 'grey', 'green'))
p

I want to add this data labels to the bars I have enter image description here

enter image description here

  • Run `dput(DATA.df)` and paste the output into your question so people can reproduce your data. Also, it would be helpful to show what you are expecting. Your question doesn't make that totally clear by "data label." – Shawn Hemelstrand Jan 26 '23 at 12:58
  • 1
    Try `+ geom_text(aes(label=after_stat(count)), stat = "count", vjust =1.25, color = "white")` – stefan Jan 26 '23 at 13:22

0 Answers0