I\'m trying to override the text in some ggplot strips to incorporate Greek characters. Here\'s some sample data, and the base for the plot.
dfr <- data.
posting this here since it's related:
If you want the name of the variable itself as well as the levels/values of the variable to be evaluated as an expression (i.e. rendered as if they were latex), try this:
label_parseall <- function(variable, value) {
plyr::llply(value, function(x) parse(text = paste(variable,
x, sep = "==")))
}
Example:
data <- data.frame(x = runif(10), y = runif(10),
gamma = sample(c("gamma[0]", "gamma[1]"), 10, rep = T))
ggplot(data, aes(x, y)) + geom_point() + facet_grid(~gamma,
labeller = label_parselabel)
image at http://img709.imageshack.us/img709/1168/parseall.png