I am trying to evaluate a variable inside theexpression function. The function works fine when the variable has no value and is just a string.
> plot(rnorm(30), xlab = expression(value~2^-dCT))
But when value is a variable, the value of the variable gets ignored…
> rm(value)
> value = "some text"
> plot(rnorm(30), xlab = expression(value~2^-dCT))
I also tried > plot(rnorm(30), xlab = expression(eval(value)~2^-dCT)) and had a similar issue…

plot(rnorm(30), xlab = expression(paste(value~2^-dCT))) does not work as well. Any help would be appreciated, thank you!
>Solution :
Here are several ways:
value <- "some text"
# 1
plot(0, xlab = substitute(value ~ 2^-dCT, list(value = value)))
# 2
plot(0, xlab = bquote(.(value) ~ 2^-dCT))
# 3
plot(0, xlab = parse(text = sprintf("'%s' ~ 2^-dCT", value)))
# 4
fo <- value ~ 2^-dCT
fo[[2]] <- as.name(value)
plot(0, xlab = fo)

