This seems like a fairly basic question, but I\'m relatively new to ggplot2 and I can\'t seem to figure this out. If there is something basic about the \"grammar\" that I\'m mis
It's recommended to use data in long format for ggplot2
, so melt your data first:
library(reshape2)
avgTerms.m <- melt(avgTerms, id.vars = "itNum")
And then assign the colours based on variable
:
ggplot(data = avgTerms.m, aes(itNum, value, colour = variable)) +
geom_line() +
labs(x = "Iteration Number", y = "Avg # of Tags Applied") +
scale_colour_manual(values = cbb)