Please see code below.
I would like to add superscripts to my y-axis, so that my "y.units.vec.time" adds a superscript to whatever choice the user picks from the menu of options.
From what I understand, I cannot use expression() properly outside of ggplot(). Is there a way I can add superscripts to my menu of choices in "y.units.vec.time"?
If I use expression() within ylab(), my input (plot.y.label) will be read literally and placed on the y-axis.
y.units.vec.conc <- c("M","mM","μM", "nM")
y.units.vec.time <- c("sec","min","hr", "day")
y.index.units.1 <- menu(y.units.vec.conc, graphics = FALSE, title = "y-axis: What are the units of concentration?")
y.index.units.2 <- menu(y.units.vec.time, graphics = FALSE, title = "y-axis: What are the units of time?")
plot.y.label <- paste("Reaction Rate", y.units.vec.conc[y.index.units.1], y.units.vec.time[y.index.units.2], sep = " ")
p_sat_curve_1 <- ggplot(data = d_sat_2, mapping = aes(x = sub.conc, y = slope.m)) +
geom_point(size = 1.5) +
theme_bw() +
xlab(plot.x.label) +
ylab(plot.y.label)