Re: [R] [Q] use of expression() in plot() vs. hist()

Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
18 Feb 1999 19:41:52 +0100

To: George White <gwhite@bodnext.bio.dfo.ca>
Subject: Re: [R] [Q] use of expression() in plot() vs. hist()
From: Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
Date: 18 Feb 1999 19:41:52 +0100
In-Reply-To: George White's message of Thu, 18 Feb 1999 14:12:52 -0400 (AST)

George White <gwhite@bodnext.bio.dfo.ca> writes:

> > First of all, I don't know where people are getting that paste()
> > construction from. The juxtaposion operator for plotting math is "*",
> > i.e.
> >
> > hist(c(0,0,0,0,4,5,6,6,6,8), xlab=expression("scaled "*rho))
> >
> The use of "paste" comes from careful reading of the documentation:
>
> > ?legend
> [...]
> ex.cs1 <- expression(plain(sin) * phi, paste("cos", phi))# 2 ways
> legend(-3, .9, ex.cs1, lty=1:2, col=2:3)
>
> "paste" and "*" are both used in "?text" as well.

I might have checked....

Anyways, there's clearly a bug in the implementation of paste(), so
'*' should be used for now.

Specifically:

static BBOX RenderConcatenate(SEXP expr, int draw)
{
BBOX bbox;
int i, n;

expr = CDR(expr);
n = length(expr);

for (i = 0; i < n; i++) {
bbox = CombineBBoxes(bbox, RenderElement(CAR(expr), draw));
if (i != n - 1)
....

starts with an uninitialised bbox, which looks unhealthy to me.

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