I have data with the word alpha
in it, and I'd like to use ggplot2 to render the alpha
in the breaks as the symbol.
df <- data.frame(Method = c("Method (alpha = 0.01)", "Method (alpha = 0.05)"),
Value = c(2,3))
ggplot(df, aes(x = Method,
y = Value)) +
geom_point()
I couldn't find this on the site, but I don't think it will be that difficult a question. I can get single values in breaks to work using the expression
command in ggplot2::xlab
, etc., but I can't figure out how to create a vector of expressions. For example, the code
c(expression("Method (alpha = 0.01)"),
+ expression("Method (alpha = 0.05)"))
gives as output
expression("Method (alpha = 0.01)", "Method (alpha = 0.05)")