Here I provide an example of what I have tried:
df <- data.frame(a = rep(c(1:12), each = 2),
b = c("yes", "no"),
c = sample(x = 1:200, size = 24))
ggplot(df, aes(x = a, y = c)) +
geom_col(aes(fill = b), position = 'dodge') +
scale_x_continuous(breaks = min(a):max(a)) +
geom_line(aes(x = a, y = c, group = b), stat = "identity")
So basically what I want to obtain is two bars for each xtick, with a line for each bar set passing by the top-center of each matching bar. I would want these two lines to have colours corresponding to the bar set they match.
I have seen a question posted here for C language. It had some similarities to this question but it was not much of a help.
If anyone knows how to achieve this I would be thankful :)