How is it possible to receive a time line plot with multiple time lines in the same plot like this:
df3 <- structure(list(id = c(6L, 6L, 2L, 3L, 6L, 7L, 3L, 5L, 7L,
4L, 6L, 7L, 7L, 3L, 6L, 6L, 6L, 7L, 6L, 6L, 3L, 6L, 6L, 3L, 6L,
7L, 6L, 6L, 7L, 6L, 7L, 6L, 3L, 5L, 6L), month = c("2011-01",
"2011-02", "2011-04", "2011-04", "2011-04", "2011-04", "2011-05",
"2011-05", "2011-05", "2011-06", "2011-06", "2011-06", "2011-07",
"2011-08", "2011-08", "2011-09", "2011-10", "2011-11", "2012-03",
"2012-04", "2012-05", "2012-05", "2012-08", "2012-09", "2012-09",
"2012-09", "2012-10", "2012-11", "2012-11", "2012-12", "2012-12",
"2013-01", "2013-02", "2013-02", "2013-02"), frq = c(1,
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1,
1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2)), row.names = c(NA, 35L
), class = "data.frame")
Additionally how is it possible to add in the x legend the year evenif the plot frequency is per month? Also, in the group variable how is is possible two show exactly which is the variable and the color of the respective line?
What I tried is this
library(ggplot2)
ggplot(df3,aes(x=month,y=frq,colour=id,group=id)) + geom_line()