We can use subscript or superscript in a plot title in R using the following
plot(1,1, main=expression('title'^2)) #superscript
plot(1,1, main=expression('title'[2])) #subscript
However, what if I want to use a string variable in expression. For example,
my_string="'title'^2"
plot(1,1, main=expression(my_string))
Clearly, this doesn't work and the plot title just becomes my_string rather than title^2.
Is it possible to use a string variable inside expression?
Thanks, Brij.