I have some data I want to put in the plot, where xaxis is of discrete type (alphabetically ordered). I have some breaks in my data causing value not appearing in the plot (some xaxis points are not appearing at all).
I would like to add these lacking xaxis values. For example, I have such data and a plot:
df <-
data.frame(x = rep(c("a", "b", "d", "e"), 2),
group = c("A", "A", "A", "A", "B", "B", "B", "B"),
value = rnorm(8))
library(ggplot2)
ggplot(df, aes(x, value, group = group, colour = group)) +
geom_line()
But I would like to add "c" value to the x axis and get something like: