Here is my example to plot multiple lines with ggplot. It generates error below
library(ggplot2)
test_df <-data.frame(dates= c('12/12/2011', '12/12/2011', '12/13/2011','12/13/2011'),
cat = c('a','b','a','b'), value = c(5,6,8,9))
ggplot(data= test_df, aes(x=dates, y = value, colour = cat)) + geom_line()
Error:
geom_path: Each group consists of only one observation. Do you
need to adjust the group aesthetic?
What am I missing? I used the following example: Stackoverflow