How to manually add legend latexed labels in qplot(), using TeX(r'()')? I have tried the following but it does not produce the desired result.
require(reshape2, ggplot2, latex2exp)
mat = matrix(1, nrow = 5, ncol = 2)
colnames(mat) = c("a","b")
df <- data.frame(m = 1:5, mat)
df.melted <- melt(df, id="m")
q <- qplot(x=m, y=value, color=variable, data=df.melted, geom="line")
q + scale_fill_discrete(name="Title",
breaks=c("a", "b"),
labels=c(TeX(r'($\tau$)'),TeX(r'($\tau$)')))
Note, expression() works, but I want TeX(r'()') since the latter is more convenient to use.