[R] Expressions in plots

David Marchette marchettedj at nswc.navy.mil
Thu Nov 9 13:38:19 CET 2000

Perhaps there is an obvious answer to this,
but I can't seem to figure it out. I want to
generate a sequence of plots, where a variable
(say x) is changed from plot to plot. For each
plot I'd like to have a title indicating the value
of x. However, what I really want is to use
expression to typeset some math. A simple
example is I'd like to do something like
expression(mu==x), where instead of the string "x"
I'd like it to put the value of x (2.35, say).
I can't figure out how to do this. Obviously
I could treat each value individually and type
in 2.35, etc, but I'd like to do this a little
more elegantly, especially since I want to change
the values of x quite a bit to explore some
property. The closest I have come is to use
paste: qq <- paste("expression(mu==",x,")",sep="")
but can't figure out how to turn qq from a string
to an expression. Thanks for any suggestions.

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list