I want to label the axis on a plot dynamically. The labels come from a data frame and contain greek letters as well as super/sub scription.
In a static case, where I wou
Turn the a and b variable into symbols with rlang::sym.
rlang::sym
library("tidyverse") a <- "alpha" b <- "beta" ggplot(data.frame(x = c(1), y = c(1)), aes(x, y)) + geom_point() + labs(x = bquote(.(sym(a))[.(sym(b))])) + labs(y = bquote(alpha[beta]))
Created on 2019-11-04 by the reprex package (v0.3.0)