'How to evaluate a varible inside an expression to use as an axis label? [duplicate]

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))

enter image description here

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))

enter image description here

I also tried > plot(rnorm(30), xlab = expression(eval(value)~2^-dCT)) and had a similar issue... enter image description here

plot(rnorm(30), xlab = expression(paste(value~2^-dCT))) does not work as well. Any help would be appreciated, thank you!

r


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source