I need to adjust the position of a text in the bar chart so that it is above the bar. Below the code used
base.total %>%
group_by(SEXO, REGIME.JURIDICO.FINAL)%>%
count() %>%
ggplot(., aes(x=reorder(SEXO, -n), y=n, fill = REGIME.JURIDICO.FINAL)) +
geom_bar(stat="identity", width = 0.2, position = "dodge") +
labs(title = "Gráfico 11: Quantidade de Inativos Civis e Militares",
subtitle = "Fonte: Base de Dados SIGRH", x = "Sexo", y="Quantidade") +
theme(axis.line.x = element_line(size = .5, colour = "black"),
axis.line.y = element_line(size = .5, colour = "black"),
axis.text.x = element_text(colour = "black", size = 7),
axis.text.y = element_text(colour = "black", size = 7),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
legend.title = element_blank()) +
geom_text(aes(label = n), size = 3.0, position = position_dodge(width = 0.2))