[R] variable value in mathplot

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Aug 29 13:37:01 CEST 2000

On Tue, 29 Aug 2000, Yudi Pawitan wrote:

> I'm putting a title over different plots, where 'that'
> varies. How do I make the value appear? Example:
> that <- 1
> plot(1:10)
> title(expression(paste(hat(theta),'= ',that)))

We've been here before. To get an expression either use parse on your
pasted character string or substitute on an expression.  There are worked
examples in the list achives. The neatest is

title(substitute(hat(theta) == that, list(that=that)))

(note it is == not =)

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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