Suppose the following data frame, I want to factorized var, and label numbers to Greek letters, from 1 to alpha, 2 to beta, 3 to gamma. But the following code does not work.
var<-c(1,1,2,2,3,3)
df<-as.data.frame(var)
df$var<-factor(df$var, levels=c(1,2,3),
labels=c("1"=expression(alpha),
"2"=expression(beta),
"3"=expression(gamma)))
Why the final data frame is not greek letters but just text expressions? Can anyone help me on this? Thanks a lot.