[R] math mode in box plots

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Apr 20 01:58:24 CEST 1999


Michael Lapsley <mlapsley at ndirect.co.uk> writes:

> Here is another of those 'is it a bug or am I using it wrong'
...
> This works:
> >plot(c(1,2,3,4),c(1,2,3,4),xlab=expression( alpha * "-1-m"))
> >
> 
> This does not:
> > boxplot(c(1,2,3,4),c(1,2,3,4),xlab=expression( alpha * "-1-m"))
> Error: Object "alpha" not found

It's a bug (apparently of the same flavor as using eval(x) to force
lazy evaluation - which works only if x is not an expression):

> title(xlab=expression(alpha*"-1-m")) # OK
> args<-list(xlab=expression(alpha*"-1-m"))
> do.call("title",args)
Error: Object "alpha" not found

Thanks for pointing it out. For a workaround, try plotting the boxplot
without the xlab, then add the xlab using title() directly.


-- 
   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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list