I would like to add an expression to a legend entry without entering the legend directly (since I am looping over variables). Essentially I would like this:
d <- data.frame(x=1:10,y=1:10,f=rep(c("0–74",">=75"),each=5))
qplot(x,y,data=d,color=f)
to output the way this does:
qplot(x,y,data=d,color=f) +
scale_colour_manual(values=1:2,breaks=c("0–74",">=75"),
labels=c(expression(0<=75), expression("">=75)))
(But actually I would like the the first entry 0<=74 to be 0-74, but I'm having trouble mixing expressions and non-expressions.)
I'm sure it's some kind of setting, but everything I've tried hasn't worked. Any ideas?