Note: I haven't found any post related to my question and I'm new to stack overflow, sorry if this has been done before.
Consider the following plot:
data.frame(var = c("a","b", "c"), num = c(2,3,4)) %>%
ggplot(aes(var, num)) +
geom_bar(stat = "identity") +
geom_point() +
geom_line()
With this I am able to make a barplot with points at the middle of each barplot. However, adding geom_line
results in the following error:
geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?
I just want to make a line that joins each point in the barplot. How do I do so?