hi all i am having a problem with the expression/paste command say we estimate a variable, named PHI it contains the value of say 2 and we want to display this value as " hat(phi) = PHI" onto a graphic i.e. " hat(phi)=2 " how does one do this? i've tried the following: 1. legend(-5,.3,expression(hat(phi)*"="*PHI)) 2. legend(-5,.3,paste(expression(phi),"=",PHI)) but they do not work. any help? / allan
Clark Allan wrote:> hi all > > i am having a problem with the expression/paste command > > say we estimate a variable, named PHI > > it contains the value of say 2 > > and we want to display this value as " hat(phi) = PHI" onto a graphic > > i.e. " hat(phi)=2 " > > how does one do this? > > i've tried the following: > > 1. legend(-5,.3,expression(hat(phi)*"="*PHI)) > > 2. legend(-5,.3,paste(expression(phi),"=",PHI))See ?plotmath or the Help Desk Article "Automation of Mathematical Annotation in Plots" in R News 2 (3), 32-34. legend(-5, .3, substitute(hat(phi) == PHI, list(PHI = PHI))) Uwe Ligges> but they do not work. > > any help? > > / > allan > > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Something like this : x <- 0.5 plot( 1:10, main=substitute( hat(Phi) ~ "=" ~ x, list(x=x) ) ) Also see http://tolstoy.newcastle.edu.au/R/help/04/09/3371.html Regards, Adai On Tue, 2005-07-19 at 13:35 +0200, Clark Allan wrote:> hi all > > i am having a problem with the expression/paste command > > say we estimate a variable, named PHI > > it contains the value of say 2 > > and we want to display this value as " hat(phi) = PHI" onto a graphic > > i.e. " hat(phi)=2 " > > how does one do this? > > i've tried the following: > > 1. legend(-5,.3,expression(hat(phi)*"="*PHI)) > > 2. legend(-5,.3,paste(expression(phi),"=",PHI)) > > but they do not work. > > any help? > > / > allan > ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
On Tue, 19 Jul 2005, Uwe Ligges wrote:> Clark Allan wrote: > >> hi all >> i am having a problem with the expression/paste command >> say we estimate a variable, named PHI >> it contains the value of say 2 >> and we want to display this value as " hat(phi) = PHI" onto a graphic >> i.e. " hat(phi)=2 " >> how does one do this? >>> > legend(-5, .3, substitute(hat(phi) == PHI, list(PHI = PHI))) >or legend(-5, .3, bquote(hat(phi) == .(PHI))) -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle