Re: [R] text-plotting math & regular mixed ?

Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
29 Jun 1999 16:55:06 +0200

To: Martin Maechler <maechler@stat.math.ethz.ch>
Subject: Re: [R] text-plotting math & regular mixed ?
From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Date: 29 Jun 1999 16:55:06 +0200

Martin Maechler <maechler@stat.math.ethz.ch> writes:

> i.e., can you ``fix'' the following function ?
>
> p.ex <- function(alpha = .05) {
>
> x <- seq(0,1, len=101)
> ch.a <- formatC(alpha,wid=1)
> plot(x, x^alpha, main=
> expression(paste("Power plot of ", x ^ alpha, " for ", alpha == {})))
> ## Where can I pass ch.a ??
> invisible()
> }

Use substitute(). Something like

e<-substitute(expression(paste("Power plot of ", x ^ alpha, " for ",
alpha == ch.a)), list(ch.a=formatC(alpha,wid=1)))

plot(x, x^alpha, main=e)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


This archive was generated by hypermail 1.02.