Skip to content

Math expression with object to evaluate

3 messages · KKThird@Yahoo.Com, Uwe Ligges, Gabor Grothendieck

#
You might want to read the "R Help Desk: Automation of Mathematical 
Annotation in Plots" in R News 2 (3), 32-34.
and you will understand that the following works:

plot(x, y, main =
   substitute("ID is" * ID.i * ", " * italic(R)^2 ==
               r2.i * {", RMSE" == error.i},
              list(ID.i = ID.i, r2.i = r2.i, error.i = error.i)))

For the next time, please make your example reproducible as the posting 
guide asks you to do.

Uwe Ligges
KKThird at Yahoo.Com wrote:
#
Use bquote:

ID <- 3
plot(1,1, main = bquote(ID ~ is ~ .(ID)))

Also please read the last line of every message to r-help regarding
reproducible examples.  (None of your variables were defined.)
On 12/22/06, KKThird at Yahoo.Com <kkthird at yahoo.com> wrote: