Skip to content
Prev 58894 / 398502 Next

expressions and paste

Hi
Thomas Lumley wrote:
Expressions (for plotting text) don't handle newlines.  A workaround 
would be to do the title "by hand" by calling mtext to place two 
separate expressions on separate lines.  Something like ...

sd2<-10
measure<-quote(mu*g*m^{-3})
chem<-quote(H[2]*SO[4])
plot_data <- function(risk,levels,chem,sd2,measure){
   plot(1,1)
   mtext(substitute("per "*sd2*measure,
                    list(sd2=sd2,measure=measure)),
         side=3, line=2)
   mtext(substitute("in usual "*chem,
                    list(chem=chem)),
         side=3, line=1)
}
plot_data(1, 2, chem, sd2, measure)

Paul