[R] variable values in plotmath expressions

Thomas Petzoldt thpe at hhbio.wasser.tu-dresden.de
Fri Sep 3 09:45:58 CEST 2004


Hello,

the following may work:

t <- "sample text"
x <- 333

plot(1, 1,
   main = expression(main[x1]),
   xlab = substitute(xxx ~ xlab[x2], list(xxx=t)),
   sub  = parse(text = paste("sub[", x, "]"))
)

Some more examples are on the ?substitute help page.


Thomas P.




More information about the R-help mailing list