Skip to content
Prev 58833 / 398502 Next

substitute/paste question for using Greek in plot titles

This is not a bug.  The object passed to `main' should be either character or an 
expression (documented in ?title).  substitute() returns neither a character 
object nor an expression -- it return a call object.  This is documented in 
?substitute:

      Substituting and quoting often causes confusion when the argument
      is 'expression(...)'. The result is a call to the 'expression'
      constructor function and needs to be evaluated with 'eval' to give
      the actual expression object.

What you want, I think, is

label <- substitute(expression(paste("A vaue for ",phi," = ",phival)), 
list(phival=phi.1))
plot(0 ~ 0, main = eval(label))

-roger
Sundar Dorai-Raj wrote: