[R] substitution in expression

Thomas Petzoldt thpe at hhbio.wasser.tu-dresden.de
Mon Sep 6 17:14:37 CEST 2004


Adaikalavan Ramasamy wrote:

 > I have been struggling with this problem for a while and I hope someone
 > could help me. Or if someone could point me to a section in the manual I
 > would be grateful.
 >
 >  x <- "my"
 >  plot(1:10, main=expression(paste( x, Delta, "values" )))

Yes, "substitution" is the correct keyword. Try the following:

  x <- "my"
  plot(1:10, main=substitute(x ~ Delta ~ "values", list(x=x)))

BTW: similar problems were explained last week.

Thomas P.




More information about the R-help mailing list