3
I’m not getting a percentage of the bar chart below. I wonder if anyone can help me.
dado <- data.frame("Estado" =c("ALESP", "ALRS", "ALMG"),
"teste" =c(9, 29,20))
library(ggplot2)
ggplot(dado, aes(x = Estado, y=teste, fill = Estado))+
geom_bar(position = position_dodge(1), stat = "identity")+
guides(fill=FALSE)+
geom_text(aes(y = teste, label = teste), vjust = -0.2,
position = position_dodge(width = 1)) +
xlab("Assembleias") +
ylab("CPIs que investigam o governo em %")
You can use the function
scale_y_continuous(labels = scales::percent)
package"scales"
– Thiago Fernandes