In the following plot, how do I add the corresponding values i.e. the medians on top of each bar?
suppressWarnings(suppressMessages(library(tidyverse)))
# Data
set.seed(123)
df <- tibble(
year = rep(2008:2017, times = 2),
type = rep(c("A", "B"), each = 10),
median = rnorm(20, mean = 15, sd =4)
)
# Plot
df %>%
ggplot(aes(x = year, y = median, fill = type)) +
geom_col(position = "dodge")
Created on 2020-11-03 by the reprex package (v0.3.0)