Trying to create a graph where both x and y are factors but I don't want the lines to be connected if there is a gap. How can I achieve this?
library(ggplot2)
df <- data.frame(x = c('a', 'b', 'c', 'd', 'e'), y = c('a', 'a', NA, 'a', 'a'))
ggplot(df, aes(x = x, y = y, group = y)) +
geom_point() +
geom_line()
Dont want the NA in the plot and there shouldn't be a line between b and d.

