1
I’m a beginner in R and I’m trying to create a bar chart and I can’t display the data labels on each bar.
Follow link to the used data frame: https://drive.google.com/open?id=1P6RLgzOgnZisI4BUYFHsEZ3b-Ca4XXd-uEg7t_Vasi
I’m using the following code:
library(ggplot2)
library(readxl)
Vendas <- read_excel("D:/BDados.xlsx", sheet = "Plan1")
ggplot(Vendas)+
stat_count(aes(ID_LOC)) +
labs(title = "Vendas", x="ID_Regioes", y="Total") +
theme_grey(base_size = 10)
My chart is getting like this:
Which one of the columns is the label? And you want it to be where, in a coma of the columns?
– Rui Barradas
I believe that the AP calls a label the numerical value corresponding to the height of the bars. That is, he wishes that, above column A, a number approximately equal to 375; above column B, almost 1200, and so on.
– Marcus Nunes
That’s right! I need data labels for all columns to appear!
– Maximiliano Prado