I have a qplot that is showing 5 different groupings (denoted with colour = type) with two dependent variables each. The command looks like this:
qplot(data = data, x = day, y = var1, geom = "line", colour = type) +
geom_line(aes(y = var2, colour = value)
I’d like to label the two different lines so that I can tell which five represent var1 and which five represent var2.
How do I do this?
You can convert the data to a “tall” format, with
melt, and use another aesthetic, such as the line type, to distinguish the variables.