Skip to content

Placing a varialbe within a text statement.

2 messages · Matt Pocernich, Thomas Lumley

#
I have a simple question.

On a plot, I would like to place text containing a calculated value.  What is the format?

For example.

I would like the following text to appear on a plot.

The average temperature is 23.1 degrees.

I'm guessing the command is 
text( x, y, "The average temperature is " %variable name% "degrees")

Thanks,
Matt Pocernich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20000202/b943cd4c/attachment.html
#
On Wed, 2 Feb 2000, Matt Pocernich wrote:

            
You're guessing incorrectly.  Try

	text(x,y,paste("The average temperature is ", variable, "degrees"))

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._