[R] legend(1,1,expression(a<-"10^-6"))

Viet Nguyen vietnguyen at fastmail.fm
Tue Apr 27 08:44:30 CEST 2004


hi all,

I have a problem with showing properly formated mathematical expressions 
in a plot.

The following works:

plot(1:10)
legend(1,10, expression(10^-6))

Howver, if my expression is kept in a char variable, I don't know how to 
show it in the legend.

# I have
st_"10^-6"
# I try to do this
plot(1:10)
legend(1,10, expression(st))
# which doesn't turn out as expected


Is it possible to convert a string into expression? Or is there a 
different way of doing what I want to do?

Thanks in advance for your help.
viet




More information about the R-help mailing list