I have gone over the examples and can't figure this out: rho<-.77 text(x=.05,y=.5,paste(expression(rho),rho)) I was hoping to get this to print a Greek rho with 0.77 beside it. Instead I get: rho 0.77 (i.e. Roman lettering) The help on expression() is quite opaque so I don't understand how it works. Thanks for any help. Bill Simpson -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Bill Simpson <W.Simpson at gcal.ac.uk> writes:> I have gone over the examples and can't figure this out: > rho<-.77 > text(x=.05,y=.5,paste(expression(rho),rho)) > > I was hoping to get this to print a Greek rho with 0.77 beside it. > Instead I get: rho 0.77 (i.e. Roman lettering) > The help on expression() is quite opaque so I don't understand how it > works.Pasting an expression and a number gives a character string before the math plotting routines get to it:> paste(expression(rho),rho)[1] "rho 0.77" try substitute(rho==val,list(val=rho)) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Bill Simpson wrote:> > I have gone over the examples and can't figure this out: > rho<-.77 > text(x=.05,y=.5,paste(expression(rho),rho)) > > I was hoping to get this to print a Greek rho with 0.77 beside it. > Instead I get: rho 0.77 (i.e. Roman lettering) > The help on expression() is quite opaque so I don't understand how it > works.It's described in ?plotmath. You can use text(x=.05,y=.5,substitute(paste(rho, rho2), list(rho2=rho))) or maybe without that paste() something like: text(x=.05, y=.5, substitute(rho == rho2, list(rho2=rho))) Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Try this instead: text(x=.05,y=.5,labels=substitute(rho*r,list(r=0.77))) or, to print "rho=0.77": text(x=.05,y=.5,labels=substitute(rho==r,list(r=0.77))) Look at ?plotmath for more help. Sundar Bill Simpson wrote:> > I have gone over the examples and can't figure this out: > rho<-.77 > text(x=.05,y=.5,paste(expression(rho),rho)) > > I was hoping to get this to print a Greek rho with 0.77 beside it. > Instead I get: rho 0.77 (i.e. Roman lettering) > The help on expression() is quite opaque so I don't understand how it > works. > > Thanks for any help. > > Bill Simpson > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-- Sundar Dorai-Raj, Ph.D. Statistical Methods Engineer PDF Solutions, Inc. (972) 889-3085 x216 (214) 392-7619 cell sundard at pdf.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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._