[R] Interpolating variables into quoted strings

William_Fitchen@oxy.com William_Fitchen at oxy.com
Wed Dec 19 22:56:30 CET 2001


Hello

I am new to R and am coming from a Perl background.  I have had trouble
figuring out from the documentation how to interpolate a variable into a
quoted string (if it's possible).  This seems to be necessary when writing a
script that must print out strings (for example plot legends) whose content
is calculated during the execution of the script.  

In perl I could write:
	
	$name = "John";
	print STDOUT "Hi $name, how's it going";

which would output the following:

	Hi John, how's it going?

Is there a function that allows a variable containing a character string or
numeric to be interpolated into a quoted character string?  Any help would
be greatly appreciated!

------------------------
William M. Fitchen
Occidental Permian Ltd.
580 Westlake Park Blvd.
Westlake 2, Rm. 431A
Houston, TX  77079
281-552-1225 (voice)
william_fitchen at oxy.com
------------------------

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