[R] help with pasting + expressions?

Charles Annis, P.E. Charles.Annis at StatisticalEngineering.com
Thu Aug 24 05:48:23 CEST 2006

Please visit the R site http://www.r-project.org/ and search the mailing
list for "paste expression"  We discussed the topic recently.  The "trick"
is that you don't paste expressions, you make an expression containing

Charles Annis, P.E.

Charles.Annis at StatisticalEngineering.com
phone: 561-352-9699
eFax:  614-455-3265

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jeff D. Hamann
Sent: Wednesday, August 23, 2006 11:02 PM
To: r-help at stat.math.ethz.ch
Subject: [R] help with pasting + expressions?

I can't believe I'm having such a hard time with this and I haven't been
able to find out how to solve this...

lab <- expression( paste( hat(v),
    as.character(round(y.hat,2)), ",",
    hat(sigma)^2, as.character(sigma.hat)) )
text( x=pt$x+2, y=pt$y,labels=lab )

## the text should be \hat{y} = <value of y.hat>, \hat{\sigma}^2 == <value
of sigma.hat>

and R keeps displaying the actual text of the non-expressions...

I must be a chowderhead, but I need a little guidance, please...


Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon 97339-1421

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list