df<-data.frame(adjuster=c(\"Mary\",\"Mary\",\"Bob\",\"Bob\",\"Mary\"),
date=as.Date(c(\"2012-1-1\",\"2012-2-1\",\"2012-3-1\",\"2012-4-1\",\"2012-5-1\")),
This way Paid column is added as a separate layer, but that means it's not in the legend. I don't get why the column Paid would go in a legend with different levels of adjuster anyway. Why is that?
library(ggplot2)
df <- data.frame(adjuster=c("Mary","Mary","Bob","Bob","Mary"),
date=as.Date(c("2012-1-1","2012-2-1","2012-3-1","2012-4-1","2012-5-1")),
total=c(10,15,25,15,20), paid=c(5,5,10,10,15))
ggplot(df, aes(x=date,y=total,color=adjuster,group=1)) +
geom_point() +
geom_line(aes(x=date, y=total, color=adjuster, group=1)) +
geom_line(aes(x=date, y=paid, group=2), data=df, colour="black") +
scale_color_discrete(name="Legend")