[R] variable value in mathplot

Emmanuel Paradis paradis at isem.univ-montp2.fr
Tue Aug 29 14:59:42 CEST 2000

At 11:36 29/08/00 +0100, you wrote:
>I'm putting a title over different plots, where 'that'
>varies. How do I make the value appear? Example:
>that <- 1
>title(expression(paste(hat(theta),'= ',that)))

I think you can use substitute(). For instance, I used this to indicate the
R-squared value on a regression plot:

text(5, 0.6, as.expression(substitute(R^2 == r, list(r=round(R2.the,3)))))

where R2.the was computed a few lines above. In your case maybe something

title(as.expression(substitute(hat(theta) == Unknown, list(Unknown=that))))

should do the trick.

Emmanuel Paradis
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